Actions Reference
This page documents supported actions, required/optional parameters, and behavior across MT4/MT5.
Tip: These parameters correspond to raw text keys parsed by the backend (see Signal Format Reference) and the fields in Message Templates (UI builder).
BUY / SELL
- Purpose: Open market orders (or pending with TYPE/PRICE)
- Required
SYMBOL
- One of:
VOL (lots) or RISK (percent of balance)
- Optional
SL, TP with TPSLType=PRICE|PIPS
SLIP slippage (where supported)
COMMENT, MAGIC
- For pending:
TYPE=LIMIT|STOP and PRICE=<limit/stop price>
- MT5 StopLimit:
STOPLIMITPRICE
- Behavior
TPSLType=PIPS: SL/TP are pip distances. MT4 handles broker-side conversion; MT5 converts to absolute prices before execution.
RISK: For MT4, lot sizing may be delegated to the broker when risk is provided. For MT5, the service computes lot size per-account.
Examples
BUY, BTCUSDz, VOL=1
SELL, BTCUSDz, RISK=2, SL=5000, TPSLType=PIPS, SLIP=10
BUY, BTCUSDz, VOL=0.01, SL=5000, TP=10000, TPSLType=PIPS
BUY, BTCUSDz, VOL=1, SL=92994.65, TP=121517.26, TPSLType=PRICE, SLIP=10
BUYLIMIT / SELLLIMIT / BUYSTOP / SELLSTOP (Pending)
- Required
SYMBOL, PRICE
VOL or RISK
- Optional
SL, TP, TPSLType=PRICE|PIPS, COMMENT, MAGIC, EXPIRATION
- MT5 only:
FILLPOLICY, EXPIRATIONTYPE, STOPLIMITPRICE (for StopLimit)
Examples
BUYLIMIT, EURUSD, PRICE=1.0845, VOL=0.2, SL=20, TP=40, TPSLType=PIPS
SELLSTOP, XAUUSD, PRICE=2370.5, VOL=0.1, SL=10, TP=30, TPSLType=PIPS
BUYSTOPLIMIT, BTCUSDz, PRICE=117500.0, STOPLIMITPRICE=117450.0, VOL=0.05, SL=5000, TP=10000, TPSLType=PIPS
MODIFY (Update SL/TP)
- Purpose: Update SL/TP on existing open positions
- Required
SYMBOL
- At least one of:
SL, TP
- Optional
TPSLType=PRICE|PIPS
SIDE=BUY|SELL|ALL to target only buy, sell, or all positions on the symbol
SLIP, COMMENT, TICKET (advanced)
- Behavior
- Use message templates (Update SL/TP) for the most robust flow.
Examples
MODIFY, BTCUSDz, SIDE=BUY, SL=10000, TP=20000, TPSLType=PIPS
MODIFY, BTCUSDz, SIDE=BUY, SL=92994.65, TP=121517.2, TPSLType=PRICE
CLOSE (Full / Partial)
- Purpose: Close open positions on a symbol
- Required
- Optional
PERCENT=1..100 (omit or 100 = full close)
SIDE=BUY|SELL|ALL
SLIP, COMMENT, TICKET
- Behavior
- Partial close reduces volume. On MT4, a new remainder ticket appears; on MT5, the same position ID volume is reduced.
- System processes the oldest open trade for the symbol (FIFO) per webhook account.
Examples
CLOSE, BTCUSDz, SIDE=BUY, PERCENT=50
CLOSE, BTCUSDz
CLOSEALL
- Purpose: Close all open positions at once
- Optional
SYMBOL to restrict to a specific symbol (or use ALL for all symbols)
- Response includes:
- Number of closed positions
- Number of cancelled pending orders
- Total profit/loss
- All ticket numbers that were closed
Examples
CLOSEALL
CLOSEALL, ALL
CLOSEALL, EURUSD
Response Example
When CLOSEALL executes, the execution log shows:
Closed 5 positions | Profit: +$0.12 | Tickets: 95052595, 95052594, 95052597...
Use CLOSEALL, ALL to close everything across all symbols, or specify a symbol to close only positions for that pair.
Notes & Nuances
- SL/TP units depend on
TPSLType.
SLIP is primarily relevant for close operations and may be ignored by some connectors for market entries.
- MT5 is position-based (simpler partial closes). MT4 is order-based (partial close yields a new ticket for the remainder).
- For complex scenarios (multi-account symbol mapping, template reuse), prefer Message Templates in the UI, which generate a correct raw text command you can copy into your alerting platform.