Cancel Syntax

Create an alert message with instructions to Cancel orders.

๐Ÿ“ 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*Cancelaction=CancelCancel action
ticketnumberticket=4974331881Ticket filter
typeBuy, BuyStop, BuyLimit, BuyStopLimit, Sell, SellStop, SellLimit, SellStopLimittype=Buy; type=SellOrder type filter
symboltextsymbol=GBPUSDOrder symbol filter

Notes:

  • 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.
For canceling pending orders, use action=Cancel


ticket

Use this key to filter orders by ticket.

When ticket is used, don't use other filters as it has no meaning.

action=Cancel, ticket=4974331881

๐Ÿ‘‰๐Ÿป Result: The pending order with ticket number = 4974331881 will be canceled.


type

Use this key to filter orders by type.

Valid type values are as below:

  • 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=Cancel, type=Buy

๐Ÿ‘‰๐Ÿป Result: All pending buy orders (BuyStop, BuyLimit, BuyStopLimit) will be canceled.


symbol

Use this key to filter orders by symbol.

Our symbol-mapping feature helps you here in some cases. For more details, please read in Buy/Sell syntax

action=Cancel, symbol=EURUSD

๐Ÿ‘‰๐Ÿป Result: All pending orders for the EURUSD symbol will be canceled.


๐Ÿ†— Examples

Example #1

action=cancel, type=buylimit

Explanation

  • Cancel pending orders
  • Process on all symbols with type is Buy Limit

Example #2

action=cancel, symbol=EURUSD, type=sell

Explanation

  • Cancel pending orders
  • Process on EURUSD symbol with type is Sell