Skip to main content

Signal Syntax Reference

Everything you need to write correct trading signals.

Basic Format

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

ParameterDescriptionExampleNotes
VOLLot size (fixed)VOL=0.1Use this OR RISK, not both
RISKRisk % of balanceRISK=2Auto-calculates lot size
SLStop LossSL=50Pips or price based on TPSLType
TPTake ProfitTP=100Pips or price based on TPSLType
TPSLTypeSL/TP unit typeTPSLType=PIPSPIPS or PRICE
SIDEDirection filterSIDE=BUYBUY, SELL, or ALL
PERCENTPartial close %PERCENT=501-100, for CLOSE action
PRICEPending order pricePRICE=1.0850For limit/stop orders
SLIPMax slippageSLIP=10Pips
MAGICMagic numberMAGIC=12345For trade identification
COMMENTOrder commentCOMMENT=MyBotText label
TICKETSpecific ticketTICKET=95052595For 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)
BUY, EURUSD, VOL=0.1
  • 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
  • SL = 1.0870
  • TP = 1.0930
Default: If TPSLType is not specified, PRICE is assumed.

SIDE Filter

Used with CLOSE and MODIFY to target specific positions.
ValueTargets
BUYOnly long positions
SELLOnly short positions
ALLAll 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

CLOSEALL, ALL

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

ErrorCauseFix
”Symbol not exist”Broker doesn’t have that symbolCheck broker symbol list or add mapping
”No open trades found for symbol”No matching trades to closeVerify symbol and direction match
”Invalid volume”Lot size below minimum or above maximumCheck broker’s min/max lot size
”Insufficient margin”Not enough balance for tradeReduce lot size or deposit funds

Next Steps