PineConnector syntax cheatsheet

Back to Syntax
LicenseID,Command,Symbol,Parameters

Format only · one ID/command/symbol; comma-separated name=value parameters. Spaces around commas optional.

Webhook URL: https://webhook.pineconnector.com (TradingView → Webhook URL)

New entries: use explicit units. One method per value. Explicit fields override corresponding legacy inputs; EA controls still apply. Omission ≠ zero/default.

LicenseID: Portal → Connections. Symbol: exact broker spelling/suffix/case. EA controls use special third fields. Message guide

Volume · choose one Source

Volume · choose one
Command / parameterMeaning / 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.

Stop loss & take profit
Command / parameterMeaning / 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.

Illustrative broker precision
DecimalsPoint1 pip20 pips
50.000010.000100.00200
30.0010.0100.200
20.010.102.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

Pending entry · choose one
Command / parameterMeaning / 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.

Market entries
Command / parameterMeaning / requirements
buy / long / bull / bullishBuy at market.
sell / short / bear / bearishSell at market.

Pyramiding and Close on Reverse apply.

Pending entries Source

Require entry method; relative SL/TP uses pending entry.

Pending entries
Command / parameterMeaning / requirements
buystopBuy above market.
buylimitBuy below market.
sellstopSell below market.
selllimitSell above market.

Close → market entry Source

Close → enter. Volume + required sizing stop; case-insensitive aliases.

Close → market entry
Command / parameterMeaning / requirements
closelongopenlong / CL+OLBuys → buy.
closelongopenshort / CL+OSBuys → sell.
closeshortopenlong / CS+OLSells → buy.
closeshortopenshort / CS+OSSells → sell.
closelongshortopenlong / CLS+OLBoth → buy.
closelongshortopenshort / CLS+OSBoth → 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.

Cancel → pending entry
Command / parameterMeaning / requirements
cancellongbuystopBuy pending → buy stop.
cancellongbuylimitBuy pending → buy limit.
cancelshortsellstopSell pending → sell stop.
cancelshortselllimitSell pending → sell limit.

Check cancellation and replacement separately.

Modify pending SL/TP Source

Modify pending SL/TP
Command / parameterMeaning / requirements
newsltpbuystopBuy stops.
newsltpbuylimitBuy limits.
newsltpsellstopSell stops.
newsltpselllimitSell 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

Close positions
Command / parameterMeaning / requirements
closelongBuys on symbol.
closeshortSells on symbol.
closelongshortBoth directions on symbol.
closeallPositions + pending across EA scope. Third field = chart symbol; not symbol-limited.

Partial closes Source

Partial closes
Command / parameterMeaning / requirements
closelongpct / closeshortpctBuy/sell reduction: EA Partial Close Percentage, not message %.
closelongvol / closeshortvolBuy/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

Cancel pending
Command / parameterMeaning / requirements
cancellongBuy stops + buy limits on symbol.
cancelshortSell stops + sell limits on symbol.

Open positions unaffected.

Modify open SL/TP Source

Modify open SL/TP
Command / parameterMeaning / requirements
newsltplongMatching buys.
newsltpshortMatching sells.

Supply ≥1 SL/TP. Absolute prices name levels; pip/% basis unconfirmed, check EA. Entry/volume unchanged.

Manual breakeven Source

Manual breakeven
Command / parameterMeaning / requirements
sl=0Entry-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

EA controls · exact third field
Command / parameterMeaning / requirements
eaoffThird field eaoff: halt processing; no closure.
eaonThird field eaon: resume; no entry. Check why halted.
closealleaoffThird 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.

Automatic breakeven
Command / parameterMeaning / 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

Pip trailing · all three required
Command / parameterMeaning / 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.

ATR trailing
Command / parameterMeaning / 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

Filters & identifiers
Command / parameterMeaning / 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.

Buy · 0.01 lot, SL 20 pips, TP 40 pips
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,tp_pips=40
Close buys · reduce 0.01 lot
LicenseID,closelongvol,EURUSD,risk=0.01
Halt EA · positions remain
LicenseID,eaoff,eaoff