Buy/Sell Syntax
Create an alert message with instructions to Buy or Sell an asset.
📐 Basic Rules
- Use Key=Value to set up instructions. Multiple keys can be separated by commas (,).
- Spacing around keys, values, or between multiple keys is not important.
- Keys are case-insensitive — upper or lower case does not matter.
- The order of Key=Value pairs is not important. You can arrange them in any order.
- Each action requires mandatory keys to be considered valid.
- Optional keys can be included to provide additional settings or data.
- Keys that are not supported by the action will be ignored.
- Maximum message length is 512 characters.
🔑 Supported Keys
| Key | Values | Example | Description |
|---|---|---|---|
| action* | Buy, Sell | action=Buy; action=Sell | Buy/Sell action |
| symbol* | text | symbol=GBPUSD | Trade symbol |
| price* | number, Market | price=1.234; price=market | Price to trade |
| size* | Volume, % Account, Amount | size=1; size=0.5%; size=1000$ | Size of trade |
| sl | Price, Point Change, % Change | size=1.234; size=10; size=0.5% | Stop loss level |
| tp | Price, Point Change, % Change | size=1.567; size=20; size=1% | Take profit level |
| break | param numbers | break=20:10 | Breakeven setup |
| trail | param numbers | trail=30:20:10 | Trailing stop setup |
| comment | text | comment=ByTradeSender | Trade comment |
Notes:
- Keys that marked with * are mandatory keys
- Missing any of mandatory keys will make the message invalid
💡 Explanation
action
Use this key to define the trade action you want to perform. This is mandatory key.
- Use
action=Buyto place a Buy order - Use
action=Sellto place a Sell order
symbol
Use this key to specify the asset you want to trade. This is mandatory key.
Our symbol-mapping feature helps you in these cases:
- Case-insensitive symbols:
If your broker requires uppercase symbols, and you send symbol=eurusd, it will be converted to EURUSD automatically. - Symbols with prefixes or suffixes:
If your broker uses prefixes or suffixes, you can configure them in the Trade Sender Connector by using Symbol Prefix and Symbol Suffix inputs.
Example:
You send → symbol=EURUSD
Broker symbol → iEURUSDm
We will map it automatically based on your setup.
price
Use this key to define the entry price. This is mandatory key.
You don’t need to specify the order type — Trade Sender determines it automatically based on the price.
-
Market execution:
Use price=Market or price=0 -
Pending orders:
If the price is above the current market price → a Buy Stop or Sell Limit is placed
If the price is below the current market price → a Buy Limit or Sell Stop is placed
size
Use this key to define the Buy/Sell size. This is mandatory key.
You can specify size in three units:
- Fixed lot size
- Percentage of Balance / Equity / Free Margin
- Amount of Account Currency.
Detailed as below:
1. Fixed lot size
Use a number without sign suffix to set fixed lot size.
action=Buy, symbol=EURUSD, price=1.2, size=0.1
👉🏻 Result: Buy 0.1 lots of EURUSD.
2. Percentage of Balance / Equity / Free Margin
Use a number with percent sign (%) suffix to use account percentage lot size.
You can set the reference (Balance, Equity, or Free Margin) in the Trade Sender Connector by using Size Percent input.
action=Buy, symbol=EURUSD, price=1.2, size=0.5%
Calculation:
- Free Margin = $10,000; Leverage = 100:1
- Trade size = 0.5% of Free Margin → $10,000 × 0.5% = $50
- Apply leverage: $50 × 100 = $5,000 position size
- Convert to lots: $5,000 ÷ 1.2 = 4,166.67 units = 0.04 standard lots (rounding applied)
👉🏻 Result: Buy 0.04 lots of EURUSD.
3. Amount of Account Currency
You can specify a fixed currency amount for the trade size by adding a dollar sign ($) suffix.
Note:
- The dollar sign is used as a symbol, but the actual currency is based on your account’s currency.
- The amount is before leverage. Your account leverage will be applied.
action=Sell, symbol=USDCAD, price=1.4, size=100$
Calculation:
- Account currency = CAD; Leverage = 100:1
- Trade size = CA$100
- Apply leverage: CA$100 × 100 = CA$10,000 position size
- Convert to lots: CA$10,000 = 10,000 units = 0.1 standard lots (rounding applied)
👉🏻 Result: Buy 0.1 lots of USDCAD.
sl
Use this key to set Stop Loss level of the trade.
You can specify stop loss level in three units:
- Fixed price
- Change in Points
- Change in Percentage
Detailed as below:
1. Fixed price Stop loss:
Use a number without sign suffix to set fixed price Stop loss.
action=Buy, symbol=EURUSD, price=1.23456, size=1, sl=1.23
👉🏻 Result: Stop loss level is price = 1.23000
2. Change in Points Stop loss:
Use a number with P suffix to use Change in Points stop loss.
- P is stand for Point, not Pip. By default, 1 Point = 1 Tick.
- You can set the point value multiple in the Trade Sender Connector by using Point Multiple input.
action=Buy, symbol=EURUSD, price=1.23456, size=1, sl=30P
Calculation:
- Tick = 0.00001 (minimum price change, based on broker and symbol); Point Multiple = 10
- 30P = 30 Points = 30 Ticks
- Apply Point Multiple: 30 × 10 = 300 Ticks
- Subtract fom entry price: 1.23456 - 300 Ticks = 1.23156
👉🏻 Result: Stop loss level is price = 1.23156
3. Change in Percentage Stop loss:
Use a number with percent sign suffix to use Change in Percentage stop loss.
action=Sell, symbol=EURUSD, price=1.23456, size=1, sl=0.5%
Calculation:
- 0.5% of entry price = 1.23456 ÷ 100 × 0.5 = 0.00617 (rounding applied)
- Adding to entry price (Sell order): 1.23456 + 0.00617 = 1.24073
👉🏻 Result: Stop loss level is price = 1.24073
tp
Use this key to set Take Profit level of the trade.
You can specify stop loss level in three units:
- Fixed price
- Change in Points
- Change in Percentage
The way it works is as same as Stop loss level.
break
Use this key to set up breakeven for the order. You can enable breakeven for an order using two parameters: Breakeven Start and Breakeven Offset.
Specify the breakeven setup as BreakevenStart:BreakevenOffset
How It Works
-
Breakeven Start
The minimum profit (in points) the position must reach before breakeven is applied. -
Breakeven Offset
The distance (in points) from the entry price where the stop loss will be moved.
When the order becomes a position and reaches the Breakeven Start value, Trade Sender Connector automatically moves/sets the stop loss to the Breakeven Offset from the entry price.
Important Notes
- The order of the parameters matters.
- Breakeven Start must be greater than Breakeven Offset.
- Both Breakeven Start and Breakeven Offset are measured in Points (away from the entry price).
- The Point Multiple setting in the Trade Sender Connector is applied.
- If the position already has a stop loss at a more profitable level, it will not be adjusted.
- The breakeven logic is fully managed by the Trade Sender Connector.
action=Buy, symbol=EURUSD, price=1.23456, size=1, break=20:10
👉🏻 Long position is opened at Entry price = 1.23456.
- If Point Multiple is 1 (by default)
When the market moves in your favor and reaches 1.23476 → The stop loss is moved to 1.23466 - If Point Multiple is 10 (as setting)
When the market moves in your favor and reaches 1.23656 → The stop loss is moved to 1.23556
trail
Use this key to set up trailing stop (Pip trailing stop method) for the order. You can enable trailing stop for an order using three parameters: Trailing Start, Trailing Distance and Trailing Step.
Specify the trailing stop setup as TrailingStart:TrailingDistance:TrailingStep
How It Works
-
Trailing Start
The minimum profit (in points) a position must reach before trailing stop starts. -
Trailing Distance
The gap (in points) that the stop loss should maintain from the current market price when being adjusted. -
Trailing Step
The minimum price movement (in points) from the last stop loss update required before making the next adjustment.
When the order becomes a position and reaches the Trailing Start, the Trade Sender Connector begins adjusting the stop loss, keeping the specified Trailing Distance from the current price. Each subsequent adjustment happens only after the market moves at least the Trailing Step in your favor.
Important Notes
- The order of the parameters matters.
- Trailing Start must be greater than Trailing Distance.
- All Trailing Start, Trailing Distance and Trailing Step are measured in Points.
- The Point Multiple setting in the Trade Sender Connector is applied.
- The trailing stop logic is fully managed by the Trade Sender Connector.
action=Sell, symbol=EURUSD, price=1.23456, size=1, break=30:20:10
👉🏻 Short position is opened at an entry price of 1.23456.
- The trailing stop activates when the market price reaches 1.23426, setting the stop loss at 1.23446.
- The next trailing stop adjustment occurs when the market price hits 1.23416, updating the stop loss to 1.23436.
comment
Use this key to set order comment.
Notes:
- No spaces or special characters allowed
- Maximum 31 characters
action=Sell, symbol=EURUSD, price=1.23456, size=1, comment=ByTradeSender
🆗 Examples
Example #1
action=buy, size=1, symbol=EURUSD, price=market
Explanation
- Place a Buy order
- Symbol is EURUSD and Size = 1
- Entry price = Market price
Example #2
action=sell, size=1, symbol=EURUSD, price=1.12345, sl=1.12456, tp=1.12123
Explanation
- Place a Sell order
- Symbol is EURUSD and Size = 1
- Entry price = 1.12345
- Set stop loss = 1.12456
- Set take profit = 1.12123
Example #3
action=buy, size=1.12345, symbol=EURUSD, price=0, sl=100P, break=20:10
Explanation
- Place a Buy order
- Symbol is EURUSD and Size = 1.12345
- Entry price = Market price
- Set stop loss = 100 points change from entry price
- Breakeven setup: start = 20, offset = 10
Example #4
action=buy, size=1.12345, symbol=EURUSD, price=market, tp=1%, trail=30:20:10
Explanation
- Place a Buy order
- Symbol is EURUSD and Size = 1.12345
- Entry price = Market price
- Set take profit = 1% change from entry price
- Trailing stop setup: start = 30, distance = 20, step = 10
Example #5
action=sell, size=1, symbol=EURUSD, price=market, sl=100P, tp=1%, break=20:10, trail=30:20:10, comment=ByTradeSender
Explanation
- Place a Sell order
- Symbol is EURUSD and Size = 1
- Entry price = Market price
- Set stop loss = 100 points change from entry price
- Set take profit = 1% change from entry price
- Breakeven setup: start = 20, offset = 10
- Trailing stop setup: start = 30, distance = 20, step = 10
- Order comment = ByTradeSender