Alert message format
How an alert message is built, every command, and the options for size, stop loss and take profit.
The Alert builder writes messages for you, but you can also write them by hand. A message is a list of values separated by commas:
LICENSE,command,SYMBOL,option=value,option=value
Example: 4F9A2C7B1D0E,buy,EURUSD,vol_lots=0.10,sl_pips=20,tp_pips=40
Commands
- buy, sell: open a trade.
- buystop, buylimit, sellstop, selllimit: pending orders, with
entry_pips,entry_priceorentry_pct. - closelong, closeshort, closelongshort: close buys, sells, or both on the symbol.
- closeall: close everything on the account. No symbol needed.
- closelongpct, closeshortpct: close part of a position, with
pct=50. - closeshortopenlong, closelongopenshort: reverse a position.
- newsltplong, newsltpshort: move stop loss and take profit on open trades.
- eaoff, eaon, closealleaoff: pause and resume the EA.
- auto: follow a TradingView strategy with one alert.
Trade size
vol_lots=0.10fixed lots.vol_pct_bal_loss=1a size that risks 1% of balance at the stop loss.vol_dollar=50a size that risks 50 in account currency.vol_pct_eq_loss,vol_pct_bal_marginalso work. Risk-based sizes need a stop loss.
Stop loss and take profit
Use pips (sl_pips=20), an exact price (sl_price=1.0850) or a percent (sl_pct=0.5). The same for tp_. They sit at the broker, so they work even when TradingView is closed.
Extras
betrigger=15,beoffset=1moves the stop to entry plus 1 pip after 15 pips profit.trailtrig=20,traildist=10,trailstep=2trailing stop.spread=2skips the trade if the spread is wider than 2 pips.comment=gold1tags the trade, so a close with the same tag only touches it.secret=yourwordrequired when you set an alert password in Settings.