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.
You don't need to learn the syntax manually because we provide the Trade Action Generator, which allows you to generate messages correctly with just a few clicks.
Supported Keys
| Key | Values | Example | Description |
|---|---|---|---|
| action* | Update | action=Update | Update action |
| type* | Positions, Long, Short, Orders, Buy, Sell | type=Positions; type=Orders | Filter positions/orders by type |
| symbol | text | symbol=GBPUSD | Filter positions/orders by symbol |
| strategy | text | strategy=stra001 | Filter positions/orders by Strategy Id |
| price | number | price=1.234 | New entry price (pending orders only) |
| sl | Price, Point Change, % Change | sl=1.234; sl=10; sl=0.5% | New SL level |
| tp | Price, Point Change, % Change | tp=1.567; tp=20; tp=1% | New TP level |
| break | param numbers | break=20:10; break=0 | New Breakeven setup |
| trail | param numbers | trail=30:20:10; trail=0:H1:14:1:0; trail=0 | New 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
type
Use this key to filter positions by type. Either ticket or type must be specified.
Valid type values are as below:
- Positions - All positions
- Long - Long positions
- Short - Short positions
- Orders - All pending orders
- Buy - All Buy Orders
- Sell - All Sell orders
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
strategy
Use this key to filter positions/orders by Strategy Id which you set on Buy/Sell orders or the Position Ticket from your broker.
Message:
action=Update, type=positions, strategy=stra0001
Result:
The positions with strategy id = stra0001 will be updated.
Message:
action=Update, type=orders, strategy=4974331881
Result:
The peinding order with ticket id = 4974331881 will be updated. Assume that you have an order with this ticket id.
price
Use this key to set new entry price. This is applied for pending orders only (entry price of positions can't be updated).
Some notes:
- New entry price must be valid for the current order type.
- New entry price must not conflicked with current SL/TP levels.
For example:
- Current market price of XAUUSD is 5000
- Current entry price of your pending buy order is 4900 (a Buy limit order)
- Current SL = 4800 and current TP = 5200
Some common invalid cases:
- Updated entry price = 5050. Because it is higher than market price and should be a Buy Stop order, not Buy Limit order anymore.
- Updated entry price = 4750. Because it is lower than your current SL level.
sl
Use this key to set new Stop Loss level. Use sl=0 if you want to remove current SL level.
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 new Take Profit level. Use tp=0 if you want to remove current TP level.
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 new breakeven. 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 new trailing stop 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.