PineConnector syntax cheatsheet
Volume · choose one Source
| Command / parameter | Meaning / requirements |
|---|---|
vol_lots= | Fixed lots; stop-independent. |
vol_dollar= | Planned loss in account currency.* |
vol_pct_bal_loss= | % of balance as planned loss.* |
vol_pct_eq_loss= | % of equity as planned loss.* |
vol_pct_bal_margin= | % of balance as margin; not capped risk. Stop-independent. |
*Needs sl_pips=, sl_price= or sl_pct= in the same message. Costs/gaps/fills can exceed budget. Floating P/L: included in equity, excluded from balance.
Broker lot limits/step apply; rounding unconfirmed.
Stop loss & take profit Source
One method per SL/TP. Buy: SL below, TP above entry; sell: reverse.
| Command / parameter | Meaning / requirements |
|---|---|
sl_pips= / tp_pips= | Pip distance. |
sl_price= / tp_price= | Absolute price. |
sl_pct= / tp_pct= | % of entry price as distance; not account risk. |
TP source · Pending distances use pending entry; open-position modification basis is unconfirmed.
Pips & broker rules Source
1 PineConnector pip = 10 quoting points. Tick size is the separate tradable price increment.
| Decimals | Point | 1 pip | 20 pips |
|---|---|---|---|
| 5 | 0.00001 | 0.00010 | 0.00200 |
| 3 | 0.001 | 0.010 | 0.200 |
| 2 | 0.01 | 0.10 | 2.00 |
All pip fields follow broker precision, including BE/trailing, ATR triggers and spread. Check Specification for tick/distance rules. Currency-independent distances.
Explicit-stop zero/negative/fractional handling unconfirmed; manual BE uses sl=0.
Pending entry · choose one Source
| Command / parameter | Meaning / requirements |
|---|---|
entry_pips= | Positive pip distance from market reference. |
entry_price= | Absolute entry; obey market side/broker rules. |
entry_pct= | Positive % of market reference as distance. |
Add distance: buystop/selllimit. Subtract: buylimit/sellstop. Confirm quote-side handling and older-EA compatibility.
Market entries Source
All entries: volume + required sizing stop. Case-insensitive aliases.
| Command / parameter | Meaning / requirements |
|---|---|
buy / long / bull / bullish | Buy at market. |
sell / short / bear / bearish | Sell at market. |
Pyramiding and Close on Reverse apply.
Pending entries Source
Require entry method; relative SL/TP uses pending entry.
| Command / parameter | Meaning / requirements |
|---|---|
buystop | Buy above market. |
buylimit | Buy below market. |
sellstop | Sell below market. |
selllimit | Sell above market. |
Close → market entry Source
Close → enter. Volume + required sizing stop; case-insensitive aliases.
| Command / parameter | Meaning / requirements |
|---|---|
closelongopenlong / CL+OL | Buys → buy. |
closelongopenshort / CL+OS | Buys → sell. |
closeshortopenlong / CS+OL | Sells → buy. |
closeshortopenshort / CS+OS | Sells → sell. |
closelongshortopenlong / CLS+OL | Both → buy. |
closelongshortopenshort / CLS+OS | Both → sell. |
Both actions are not guaranteed to complete. Verify close and entry separately.
Cancel → pending entry Source
Require entry method + volume + sizing stop if needed.
| Command / parameter | Meaning / requirements |
|---|---|
cancellongbuystop | Buy pending → buy stop. |
cancellongbuylimit | Buy pending → buy limit. |
cancelshortsellstop | Sell pending → sell stop. |
cancelshortselllimit | Sell pending → sell limit. |
Check cancellation and replacement separately.
Modify pending SL/TP Source
| Command / parameter | Meaning / requirements |
|---|---|
newsltpbuystop | Buy stops. |
newsltpbuylimit | Buy limits. |
newsltpsellstop | Sell stops. |
newsltpselllimit | Sell limits. |
Supply ≥1 SL/TP. Relative pips/% uses pending entry; entry stays unchanged.
Management scope Source
One LicenseID may reach several accounts. Symbol commands select symbol/direction. Magic Restriction controls manual/other-EA eligibility; supported exact comment= filters narrow scope. Omission can broaden it.
Close positions Source
| Command / parameter | Meaning / requirements |
|---|---|
closelong | Buys on symbol. |
closeshort | Sells on symbol. |
closelongshort | Both directions on symbol. |
closeall | Positions + pending across EA scope. Third field = chart symbol; not symbol-limited. |
Partial closes Source
| Command / parameter | Meaning / requirements |
|---|---|
closelongpct / closeshortpct | Buy/sell reduction: EA Partial Close Percentage, not message %. |
closelongvol / closeshortvol | Buy/sell reduction: required risk= lots. |
risk= | Lots to close here; not entry risk or vol_lots=. |
Volume close processes positions in order; excess closes all available. Ticket order/allocation/rounding unconfirmed; not necessarily proportional. sl=0 adds conditional BE on remainder.
Cancel pending Source
| Command / parameter | Meaning / requirements |
|---|---|
cancellong | Buy stops + buy limits on symbol. |
cancelshort | Sell stops + sell limits on symbol. |
Open positions unaffected.
Modify open SL/TP Source
| Command / parameter | Meaning / requirements |
|---|---|
newsltplong | Matching buys. |
newsltpshort | Matching sells. |
Supply ≥1 SL/TP. Absolute prices name levels; pip/% basis unconfirmed, check EA. Entry/volume unchanged.
Manual breakeven Source
| Command / parameter | Meaning / requirements |
|---|---|
sl=0 | Entry-price SL via modification/partial close; not sl_pips=0. |
Requires profit + broker distance from entry. Rejection may retain old SL; check SL and retained TP before retrying.
EA controls · exact third field Source
| Command / parameter | Meaning / requirements |
|---|---|
eaoff | Third field eaoff: halt processing; no closure. |
eaon | Third field eaon: resume; no entry. Check why halted. |
closealleaoff | Third field = chart symbol: close positions/cancel pending in EA scope, then halt. Not symbol-limited. Verify each. |
Automatic breakeven Source
Both required. Add managers on entry; loss sizing still needs initial explicit SL. Test interactions.
| Command / parameter | Meaning / requirements |
|---|---|
betrigger= | Favourable pips; >0. |
beoffset= | Pips from entry; <trigger. 0 = entry; positive = above buy / below sell entry. |
Moves SL once; broker distance applies. BE does not guarantee zero net loss.
Pip trailing · all three required Source
| Command / parameter | Meaning / requirements |
|---|---|
trailtrig= | Activation pips; negative can start immediately, zero may depend on spread. Confirm boundaries. |
traildist= | Pips from current price to SL; can add absent SL on activation. |
trailstep= | Further favourable pips per tightening. |
Buy SL below/sell above price; never loosens on pullback. Fraction rounding direction/ties unconfirmed. BE/pip trailing ignore legacy Target Type.
ATR trailing Source
atrtimeframe= + atrperiod= both required.
| Command / parameter | Meaning / requirements |
|---|---|
atrtimeframe= | Minutes. MT4: 1, 5, 15, 30, 60, 240, 1440; confirm other MT5 choices. |
atrperiod= | ATR periods (e.g. 14). |
atrmultiplier= | Distance multiplier; default 1. |
atrshift= | Bar offset; default 0. Closed-bar mapping unconfirmed. |
atrtrigger= | Favourable pips; default 0 (immediate, subject to initial-SL placement). |
Broker MetaTrader data; updates each selected bar close. Candidate SL = current price ± ATR × multiplier (buy − / sell +); convert pip ATR to price first. Can add absent SL. Confirm tighter-stop handling before widening.
Filters & identifiers Source
| Command / parameter | Meaning / requirements |
|---|---|
spread= | Entry pips, decimals allowed: arrival (Ask − Bid) ÷ pip size ≤ limit. Other checks still apply. |
accfilter= | EA Account Filter Type/Basis threshold: balance/equity/free margin (account currency) or margin %. Confirm comparison/equality. |
comment= | Label ≤20 chars; spaces allowed, avoid commas. Exact filters only documented for closelong, closeshort, cancellong, cancelshort. Other support/limits unconfirmed. |
secret= | Case-sensitive; required if enabled. Missing/different key prevents forwarding. Not supplied by ID personalization. Setup. |
Complete illustrative requests Example guidance
Illustrations, not executed tests. Paste into TradingView → Message; replace LicenseID, symbol and values; add secret= privately if enabled (never a broker password). Demo-test; verify receipt, processing and resulting orders on every account.
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,tp_pips=40LicenseID,closelongvol,EURUSD,risk=0.01LicenseID,eaoff,eaoff