Update Syntax
Create an alert message with instructions to update orders or positions.
๐ 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 | Updated Breakeven setup |
| trail | param numbers | trail=30:20:10 | Updated Trailing stop setup |
Notes:
- 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.
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.
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. You can enable breakeven for an order using two parameters: Breakeven Start and Breakeven Offset.
These two values must be provided in this order and separated by a colon BreakevenStart:BreakevenOffset
For detailed explanation with examples of breakeven setup, please read in Buy/Sell syntax
To disable a previously configured breakeven, use break=0
action=Update, type=Orders, break=0
๐๐ป Remove breakeven setup in all pending orders.
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.
These three values must be provided in this order and separated by a colon TrailingStart:TrailingDistance:TrailingStep
For detailed explanation with examples of trailing stop setup, please read in Buy/Sell syntax
To disable a previously configured breakeven, use trail=0
action=Update, type=Positions, trail=0
๐๐ป 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
- 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
- Trailing stop setup: start = 30, distance = 20, step = 10