Update 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* | Update | action=Update | Update action |
| ticket* | number | ticket=4974331881 | Ticket filter |
| type* | Positions, Long, Short, Orders, Buy, BuyStop, BuyLimit, BuyStopLimit, Sell, SellStop, SellLimit, SellStopLimit | type=Positions; type=Orders | Type filter |
| symbol | text | symbol=GBPUSD | Position symbol filter |
| sl | Price, Point Change, % Change | size=1.234; size=10; size=0.5% | Updated Stop loss level |
| tp | Price, Point Change, % Change | size=1.567; size=20; size=1% | Updated Take profit level |
| break | param numbers | break=20:10; break=0 | Updated Breakeven setup |
| trail | param numbers | trail=30:20:10; trail=0:H1:14:1:0; trail=0 | Pip or ATR Trailing stop setup |
Keys that marked with * are mandatory keys. Missing any of mandatory keys will make the message invalid. Only the ticket or type key is required, and at least one must be provided.
💡 Explanation
action
Use this key to define the trade action you want to perform. This is mandatory key.
For updating orders/positions, use action=Update
ticket
Use this key to filter orders/positions by ticket. Either ticket or type must be specified.
When ticket is used, don't use other filters as it has no meaning.
Message:
action=Update, ticket=4974331881
Result:
The position/order with ticket number = 4974331881 will be updated.
type
Use this key to filter positions by type. Either ticket or type must be specified.
Valid type values are as below:
- Positions - All position types (Long, Short)
- Long - Long positions
- Short - Short positions
- Orders - All orders types (BuyStop, BuyLimit, BuyStopLimit, SellStop, SellLimit, SellStopLimit)
- Buy - All Buy orders (BuyStop, BuyLimit, BuyStopLimit)
- BuyStop - Buy stop orders
- BuyLimit - Buy limit orders
- BuyStopLimit - Buy stop-limit orders
- Sell - All Sell orders (SellStop, SellLimit, SellStopLimit)
- SellStop - Sell stop orders
- SellLimit - Sell limit orders
- SellStopLimit - Sell stop-limit orders
Please aware that some order types (such as BuyStopLimit or SellStopLimit) are not supported in MT4.
Message:
action=Update, type=Long
Result:
All Long positions wil be updated.
symbol
Use this key to specify the asset you want to trade.
Our symbol-mapping feature helps you here in some cases. For more details, please read in Buy/Sell syntax
sl
Use this key to update Stop Loss level of the trade.
You can specify stop loss level in three units:
- Fixed price
- Change in Points
- Change in Percentage
For detailed explanation with examples of these units, please read in Buy/Sell syntax
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
For detailed explanation with examples of these units, please read in Buy/Sell syntax
break
Use this key to set up breakeven for the order. For detailed explanation with examples of breakeven setup, please read in Buy/Sell syntax
To disable a previously configured breakeven, use break=0
Message:
action=Update, type=Orders, break=0
Result:
Remove breakeven setup in all pending orders.
trail
Use this key to set up trailing stop for the order. For detailed explanation with examples of trailing stop setup, please read in Buy/Sell syntax
To disable a previously configured trailing stop, use trail=0
Message:
action=Update, type=Positions, trail=0
Result:
Remove trailing stop setup in all positions.
🆗 Examples
Example #1
action=update, ticket=4974331881, sl=1.23456
Explanation
- Update order/position with ticket = 4974331881
- Set stop loss = 1.23456
Example #2
action=update, ticket=4974331881, sl=1.23456, tp=0
Explanation
- Update order/position with ticket = 4974331881
- Set stop loss = 1.23456
- Remove take profit
Example #3
action=update, type=buy, sl=1.23456, tp=0, break=0, trail=0
Explanation
- Update pending orders with type is Buy
- Process on all symbols
- Set stop loss = 1.23456
- Remove take profit
- Breakeven setup: Disable
- Trailing stop setup: Disabled
Example #4
action=update, type=selllimit, sl=1.23456, tp=0, break=20:10
Explanation
- Update pending orders with type is Sell Limit
- Process on all symbols
- Set stop loss = 1.23456
- Remove take profit
- Breakeven setup: start = 20, offset = 10
Example #5
action=update, type=long, break=0, trail=30:20:10
Explanation
- Update open positions with type is Long
- Process on all symbols
- Breakeven setup: Disable
- Pip trailing stop setup: start = 30, distance = 20, step = 10
Example #6
action=update, type=long, sl=1.23456, tp=1.23789, break=20:10, trail=30:20:10
Explanation
- Update open positions with type is Long
- Process on all symbols
- Set stop loss = 1.23456
- Set take profit = 1.23789
- Breakeven setup: start = 20, offset = 10
- Pip trailing stop setup: start = 30, distance = 20, step = 10