Buy/Sell Message Syntax
๐ 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; trail=0:H1:14:1:0 | Pip or ATR Trailing stop setup |
| comment | text | comment=ByPipSender | Trade comment |
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 Pip Receiver 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. It's automatically determined 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
1. Fixed lot size
Use a number without sign suffix to set fixed lot size.
Message:
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 Pip Receiver by using Size Percent input.
Message:
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.
Notes:
- 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.
Message:
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:
1. Fixed price Stop loss:
Use a number without sign suffix to set fixed price Stop loss.
Message:
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 Pip Receiver by using Point Multiple input.
Message:
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.
Message:
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. The way it works is as same as Stop loss level.
break
Use this key to set up breakeven for the order. Specify the breakeven setup as Start:Offset
- Start: The trigger level, measured from the entry price, that activates the Breakeven. It must be > 0 and > Offset
- Offset: The price offset, calculated from the entry price, to which the stop loss is adjusted. Must be >= 0
Important Notes
- The order of the parameters matters.
- Both Breakeven Start and Breakeven Offset are measured in Points (away from the entry price).
- The Point Multiple setting in the Pip Receiver is applied.
- If the existing stop-loss level provides a more favorable profit, it will remain unchanged.
- The breakeven logic is fully managed by the Pip Receiver.
Message:
action=Buy, symbol=EURUSD, price=1.23456, size=1, break=20:10
Result:
- Long position opened at 1.23456 (entry price)
- Price reaches 1.23476 (Start = 20) โ stop loss moves to 1.23466 (Offset = 10)
trail
Use this key to enable Pip or ATR trailing stops.
Pip Trailing Stop:
Specify the Pip trailing stop setup as Start:Distance:Step
- Start: The trigger level, measured from the entry price, that activates the trailing stop. Must be >= 0
- Distance: The gap maintained between the current price and the stop-loss level. Must be > 0
- Step: The minimum price movement in your favor required before each new stop-loss adjustment. Must be > 0
Message:
action=Buy, symbol=EURUSD, price=1.23456, size=1, trail=30:20:10
Result:
- Long position opened at 1.23456 (entry price)
- Price reaches 1.23486 (Start = 30) โ stop loss moves to 1.23466 (Distance = 20)
- Price reaches 1.23496 (Step = 10) โ stop loss moves to 1.23476 (Distance = 20)
- And so on...
Important Notes
- The order of the parameters matters.
- All Start, Distance and Step are measured in Points.
- The Point Multiple setting in the Pip Receiver is applied.
- The trailing stop logic is fully managed by the Pip Receiver.
ATR Trailing Stop:
Specify the ATR trailing stop setup as Start:Timeframe:Period:Multiplier:Shift
- Start: The trigger level, measured from the entry price, that activates the trailing stop. Must be >= 0
- Timeframe: The timeframe used to calculate the ATR value.
- Period: The number of periods used in the ATR calculation. Must be > 0
- Multiplier: The ATR multiplier used to determine the trailing stop distance. Must be > 0
- Shift: The candle offset used for ATR calculation; 0 refers to the current candle. Must be >= 0
Message:
action=Buy, symbol=EURUSD, price=1.23456, size=1, trail=10:H1:14:1:0
Result:
- Assume that ATR value at the current candle (Offset = 0) is 0.001. The ATR value is calculated with Timeframe = H1, Period = 14 and Multiplier = 1 as settings
- Long position opened at 1.23456 (entry price).
- Price reaches 1.23466 (Start = 10) โ stop loss moves to 1.23366 (ATR = 0.001)
- Price reaches 1.23467 โ stop loss moves to 1.23367
- And so on...
Important Notes
- The order of the parameters matters.
- All Start is measured in Pointsand Point Multiple setting in the Pip Receiver is applied.
- ATR is an absolute value and updates continuously as market prices change.
- MT4 supported timeframe values : M1, M5, M15, M30, H1, H4, D1, W1, MN1
- MT5 supported timeframe values: M1, M2, M3, M4, M5, M6, M10, M12, M15, M20, M30, H1, H2, H3, H4, H6, H8, H12, D1, W1, MN1
- The trailing stop logic is fully managed by the Pip Receiver.
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=ByPipSender
๐ 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
- Pip 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=ByPipSender
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
- Pip trailing stop setup: start = 30, distance = 20, step = 10
- Order comment = ByPipSender