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

KeyValuesExampleDescription
action*Updateaction=UpdateUpdate action
ticket*numberticket=4974331881Ticket filter
type*Positions, Long, Short, Orders, Buy, BuyStop, BuyLimit, BuyStopLimit, Sell, SellStop, SellLimit, SellStopLimittype=Positions; type=OrdersType filter
symboltextsymbol=GBPUSDPosition symbol filter
slPrice, Point Change, % Changesize=1.234; size=10; size=0.5%Updated Stop loss level
tpPrice, Point Change, % Changesize=1.567; size=20; size=1%Updated Take profit level
breakparam numbersbreak=20:10Updated Breakeven setup
trailparam numberstrail=30:20:10Updated 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