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
| Key | Values | Example | Description |
|---|---|---|---|
| action* | Cancel | action=Cancel | Cancel action |
| ticket | number | ticket=4974331881 | Ticket filter |
| type | Buy, BuyStop, BuyLimit, BuyStopLimit, Sell, SellStop, SellLimit, SellStopLimit | type=Buy; type=Sell | Order type filter |
| symbol | text | symbol=GBPUSD | Order 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