Signal Syntax Reference
Everything you need to write correct trading signals.
ACTION, SYMBOL, PARAM1=VALUE, PARAM2=VALUE, ...
Rules:
- Parameters separated by comma + space (
, )
- Parameter names are case-insensitive (
VOL = vol = Vol)
- Order doesn’t matter after ACTION and SYMBOL
- Spaces around
= are optional
Quick Reference Table
| Parameter | Description | Example | Notes |
|---|
VOL | Lot size (fixed) | VOL=0.1 | Use this OR RISK, not both |
RISK | Risk % of balance | RISK=2 | Auto-calculates lot size |
SL | Stop Loss | SL=50 | Pips or price based on TPSLType |
TP | Take Profit | TP=100 | Pips or price based on TPSLType |
TPSLType | SL/TP unit type | TPSLType=PIPS | PIPS or PRICE |
SIDE | Direction filter | SIDE=BUY | BUY, SELL, or ALL |
PERCENT | Partial close % | PERCENT=50 | 1-100, for CLOSE action |
PRICE | Pending order price | PRICE=1.0850 | For limit/stop orders |
SLIP | Max slippage | SLIP=10 | Pips |
MAGIC | Magic number | MAGIC=12345 | For trade identification |
COMMENT | Order comment | COMMENT=MyBot | Text label |
TICKET | Specific ticket | TICKET=95052595 | For CLOSE/MODIFY |
Actions
Market Orders
BUY
Open a long position at market price.
BUY, EURUSD, VOL=0.1
BUY, EURUSD, RISK=2, SL=30, TP=60, TPSLType=PIPS
BUY, BTCUSD, VOL=0.01, SL=95000, TP=105000, TPSLType=PRICE
SELL
Open a short position at market price.
SELL, GBPUSD, VOL=0.05
SELL, GBPUSD, RISK=1.5, SL=40, TP=80, TPSLType=PIPS
Pending Orders
BUYLIMIT
Buy when price drops to target.
BUYLIMIT, EURUSD, PRICE=1.0800, VOL=0.1, SL=30, TP=60, TPSLType=PIPS
SELLLIMIT
Sell when price rises to target.
SELLLIMIT, EURUSD, PRICE=1.1000, VOL=0.1, SL=30, TP=60, TPSLType=PIPS
BUYSTOP
Buy when price rises to target (breakout).
BUYSTOP, EURUSD, PRICE=1.0950, VOL=0.1, SL=30, TP=60, TPSLType=PIPS
SELLSTOP
Sell when price drops to target (breakdown).
SELLSTOP, EURUSD, PRICE=1.0850, VOL=0.1, SL=30, TP=60, TPSLType=PIPS
Close Positions
CLOSE
Close positions for a specific symbol.
CLOSE, EURUSD
CLOSE, EURUSD, SIDE=BUY
CLOSE, EURUSD, SIDE=BUY, PERCENT=50
CLOSE, EURUSD, TICKET=95052595
Parameters:
SIDE - Filter by direction (BUY, SELL, ALL)
PERCENT - Partial close (1-100)
TICKET - Close specific ticket
Behavior:
- Without TICKET: Uses FIFO (closes oldest trade first)
- With PERCENT: Partial close, remainder stays open
- Symbol must match exactly (use symbol mapping if needed)
CLOSEALL
Close all positions at once.
CLOSEALL
CLOSEALL, ALL
CLOSEALL, EURUSD
Response includes:
- Number of closed positions
- Number of cancelled pending orders
- Total profit/loss
- All ticket numbers
Modify Orders
MODIFY
Update SL/TP on existing positions.
MODIFY, EURUSD, SIDE=BUY, SL=1.0900, TP=1.1000, TPSLType=PRICE
MODIFY, EURUSD, SIDE=ALL, SL=20, TP=50, TPSLType=PIPS
MODIFY, EURUSD, TICKET=95052595, SL=1.0850
Parameter Details
VOL vs RISK
Use either VOL or RISK, not both in the same signal.
VOL (Fixed Lots)
- Trades exactly 0.1 lots
- Same size regardless of account balance
- Good for: Fixed position sizes
RISK (Dynamic Sizing)
BUY, EURUSD, RISK=2, SL=30, TPSLType=PIPS
- Calculates lot size based on:
- Account balance
- Stop loss distance
- Risk percentage (2% of balance)
- Good for: Consistent risk management
TPSLType
PIPS - SL/TP values are pip distances from entry
BUY, EURUSD, VOL=0.1, SL=30, TP=60, TPSLType=PIPS
- SL = 30 pips below entry
- TP = 60 pips above entry
PRICE - SL/TP values are absolute price levels
BUY, EURUSD, VOL=0.1, SL=1.0870, TP=1.0930, TPSLType=PRICE
Default: If TPSLType is not specified, PRICE is assumed.
SIDE Filter
Used with CLOSE and MODIFY to target specific positions.
| Value | Targets |
|---|
BUY | Only long positions |
SELL | Only short positions |
ALL | All positions (default) |
CLOSE, EURUSD, SIDE=BUY // Close only buys
CLOSE, EURUSD, SIDE=SELL // Close only sells
CLOSE, EURUSD, SIDE=ALL // Close all EURUSD
Copy-Paste Templates
Entry with Risk Management (Recommended)
BUY, {{ticker}}, RISK=2, SL=30, TP=60, TPSLType=PIPS
Fixed Lot Entry
BUY, EURUSD, VOL=0.1, SL=30, TP=60, TPSLType=PIPS
Exit All Positions
Close Symbol Positions
CLOSE, {{ticker}}, SIDE=ALL
Partial Take Profit (50%)
CLOSE, {{ticker}}, SIDE=BUY, PERCENT=50
Trailing Stop Update
MODIFY, {{ticker}}, SIDE=BUY, SL={{low}}, TPSLType=PRICE
Pending Limit Order
BUYLIMIT, {{ticker}}, PRICE={{close}}, VOL=0.1, SL=30, TP=60, TPSLType=PIPS
Common Errors
| Error | Cause | Fix |
|---|
| ”Symbol not exist” | Broker doesn’t have that symbol | Check broker symbol list or add mapping |
| ”No open trades found for symbol” | No matching trades to close | Verify symbol and direction match |
| ”Invalid volume” | Lot size below minimum or above maximum | Check broker’s min/max lot size |
| ”Insufficient margin” | Not enough balance for trade | Reduce lot size or deposit funds |
Next Steps