Skip to content
Docs
Open Portal
Copy manually

Your browser did not allow direct clipboard access. Select and copy the text below.

PineConnector Syntax

Find a command, choose its units, copy a complete example.

Message schematicStructure only. The complete examples below supply an action and its values.
TradingView → Message PineConnector Syntax
LicenseID,Command,Symbol,Parameters
FieldMeaning
LicenseIDYour connection ID. One ID can reach several accounts. Find it in Portal Connections.
CommandOne action, such as buy, sell or closelong.
SymbolThe exact broker symbol, including suffix and letter case. EA controls have special third fields.
ParametersThe action’s values, each written as name=value.

Keep this field order, separated by commas. Spaces around commas are optional. Use one License ID, command and symbol per message. Pine Script is the separate programming language that can generate these messages.

Webhook URL
https://webhook.pineconnector.com

Paste separately into TradingView’s Webhook URL field.

Illustrative requests, not executed trades. Paste one complete example into TradingView → Message. Replace LicenseID and the broker symbol, adapt the values, add your secret= if authentication is enabled, and test on demo. Check receipt and the actual account/order outcome separately.

Buy a fixed size
Buy a fixed size
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,tp_pips=40

Requests a 0.01-lot buy with a 20-pip stop and 40-pip target.

Choose a planned cash loss
Choose a planned cash loss
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_dollar=100,sl_pips=20

Targets a loss of 100 in account currency at the 20-pip stop. The stop is required for sizing; actual loss can differ.

Close EURUSD buys
Close EURUSD buys
TradingView → Message PineConnector Syntax
LicenseID,closelong,EURUSD

Requests closure of matching EURUSD buys on every receiving account. Magic Restriction and supported comment filters determine eligible positions; manual trades can be in scope.

Use explicit units for new alerts. Choose one method per value. Explicit fields override corresponding legacy inputs, while other EA controls still apply. Omission does not establish a zero or default value; check receiving settings where no default is stated.

Choose one method for each entry. Check the broker’s minimum, maximum and volume step.

Method Unit and requirement
vol_lots= Fixed lots. 0.01 requests 0.01 lot. Stop distance does not size the position.
vol_dollar= Cash loss budget, in account currency despite the name. 100 targets 100 at the stop. Requires one explicit stop in the same message.
vol_pct_bal_loss= Percentage of balance to risk. 1 targets 1% of balance at the stop. Requires one explicit stop in the same message.
vol_pct_eq_loss= Percentage of equity to risk. 1 targets 1% of equity at the stop. Requires one explicit stop in the same message.
vol_pct_bal_margin= Percentage of balance as margin. 5 allocates 5% as margin; it does not limit loss to 5%. Stop distance is not used for sizing.

For each loss-based method, supply one of sl_pips=, sl_price= or sl_pct=. Balance excludes floating profit/loss; equity includes it. With an illustrative USD 10,000 balance and USD 9,100 equity, 1% means USD 100 or USD 91 respectively. A 5% margin allocation means USD 500; resulting lots require the broker’s margin calculation and leverage.

Use balance for the risk amount
Use balance for the risk amount
TradingView → Message PineConnector Syntax
LicenseID,sell,EURUSD,vol_pct_bal_loss=1,sl_pips=20

With USD 10,000 balance, the loss budget is USD 100. Under the slider’s pip-value assumptions, a 20-pip stop gives 0.50 lots before broker rounding.

Use equity for the risk amount
Use equity for the risk amount
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_pct_eq_loss=1,sl_pips=20

Uses current equity for the loss budget, including floating profit or loss. The stop remains required.

Allocate margin
Allocate margin
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_pct_bal_margin=5,sl_pips=20

Allocates 5% of balance as margin. The stop does not determine its volume or cap realised loss.

Loss sizing: lots = budget ÷ (stop distance in pips × pip value per 1.00 lot). A price or percentage stop first supplies a price distance; divide it by the symbol’s pip size. Costs, gaps and fills can make realised loss exceed the budget.

A wider stop means a smaller position

Keep the planned loss at USD 100. Change the stop distance and see how the calculated lot size changes.

Lots

Stop distance · pips

Planned loss
USD 100
vol_dollar=100
Stop distance
20 pips
Chosen for this example
Calculated size
0.50 lots
Before volume rounding

100 ÷ (20 × 10) = 0.5 lots.

Illustrative FX-5 EURUSD, USD account, 100,000 EUR contract and USD 10 per pip per lot; all calculated lots are before broker volume rounding. Real sizing uses broker contract details and volume limits; costs and execution can change the loss.

Calculated example; not an executed trade.

At 20 pips, USD 100 ÷ (20 × USD 10) = 0.50 lots. Doubling the stop to 40 pips halves the size to 0.25 lots. These are calculated requests before broker volume rounding.

With the USD 91 equity budget, the same calculation gives 0.455 lots. On a 0.01 volume step, do not assume 0.45 or 0.46: the EA’s rounding direction is unconfirmed. Find your account and broker inputs before adapting these calculations.

Choose one stop method. On an entry, a buy SL is below the applicable entry price; a sell SL is above it. All three methods can supply the stop for loss-based volume.

Method Unit and example value
sl_pips= Distance in PineConnector pips. 20 means entry minus 20 × pip size for a buy, plus that distance for a sell.
sl_price= Absolute price. 1.09500 requests that level directly, without a distance calculation.
sl_pct= Percentage of entry price. 1 means entry × 1% as the distance: subtract for a buy, add for a sell. It does not mean 1% account risk.

One PineConnector pip = 10 symbol quoting points. Use the broker’s precision, not the asset name. This convention also applies to pip targets, pending entries, breakeven, trailing, ATR triggers and spread.

Illustrative precision Quoting Point → one pip 20-pip price distance
Five decimals 0.00001 → 0.00010 0.00200
Three decimals 0.001 → 0.010 0.200
Two decimals 0.01 → 0.10 2.00

Point and tick size differ: tick size sets tradable price increments. Prices must meet broker distance and tick rules; look them up in Specification. Account currency does not change these price distances when entry and pip size are fixed.

One entry, three ways to set the stopIllustrative buy at 1.10000 · one price scale
1.10000Buy entryFX-5 · EURUSD
1.09800sl_pips=2020 × 0.00010 = 0.00200 price distance
1.09500sl_price=1.09500Use the supplied level. No conversion.
1.08900sl_pct=11.10000 × 1% = 0.01100 price distance

From a buy entry of 1.10000, sl_pips=20 requests 1.09800, sl_price=1.09500 requests 1.09500, and sl_pct=1 requests 1.08900. Vertical gaps use the same price scale. Pips convert as 20 × 0.00010 = 0.00200; percentage converts as 1.10000 × (1 ÷ 100) = 0.01100. The exact price uses the supplied level without conversion.

Calculated example; not an executed trade. These values illustrate units, not recommended stop distances.

Stop at an exact price
Stop at an exact price
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_price=1.09500

Requests the supplied stop at 1.09500. It must be valid for the broker’s current quote, tick size and minimum distance.

Pending SL distances use the pending entry. Open-position modifications have a separate, unconfirmed relative-price basis; use their local guidance. Zero, negative and fractional explicit-stop handling is not established here. For manual breakeven, use the documented sl=0 exception.

Choose one target method if adding a TP. A buy target is above the applicable entry; a sell target is below it. Use the same pip convention and broker constraints as Stop loss.

Method Unit and example value
tp_pips= Pip distance. 40 means entry plus 40 × pip size for a buy, minus that distance for a sell.
tp_price= Absolute price. 1.10400 requests that exact level.
tp_pct= Percentage of entry price. 2 means entry × 2% as the distance: add for a buy, subtract for a sell.
Target by price percentage
Target by price percentage
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pct=1,tp_pct=2

At an illustrative buy entry of 1.10000, the 2% target distance is 0.02200: TP 1.12200. The 1% SL is 1.08900. These percentages use price, not account balance.

Pending TP distances use the pending entry. Modifying open positions is a separate operation.

Include one volume method, plus a stop when required for sizing. Accepted aliases are case-insensitive.

Command Action and aliases
buy Buy at market. Aliases: long, bull, bullish.
sell Sell at market. Aliases: short, bear, bearish.

The fixed-size starter is a complete market example. Receiving Pyramiding and Close on Reverse settings can affect an entry; check the EA configuration.

Every pending order requires one entry method, one volume method and any stop required for sizing.

Command Requested entry side
buystop Above market, buying after a rise.
buylimit Below market, buying after a pullback.
sellstop Below market, selling after a fall.
selllimit Above market, selling after a rebound.
Entry method Value supplied
entry_pips= Positive pip distance from the current market reference. 20 means 20 × pip size.
entry_price= Absolute entry price, such as 1.09500. Check the command’s side of market and broker price rules.
entry_pct= Positive percentage of the current market reference. 1 means market reference × 1% as the distance.

For relative entries, add the distance for buystop/selllimit; subtract it for buylimit/sellstop. Then measure relative SL/TP from the requested pending entry, including when modifying pending targets. An absolute price requires no conversion. The illustration omits spread; confirm actual quote-side and price handling on the receiving EA.

Choose the entry price
Choose the entry price
TradingView → Message PineConnector Syntax
LicenseID,buylimit,EURUSD,vol_lots=0.01,entry_price=1.09500,sl_pips=20

Requests a buy limit at 1.09500 and, with one pip = 0.00010, SL at 1.09300. The stop is measured from the requested entry.

Choose a percentage entry distance
Choose a percentage entry distance
TradingView → Message PineConnector Syntax
LicenseID,buystop,EURUSD,vol_lots=0.01,entry_pct=1,sl_pips=20

With market reference 1.10000, the 1% offset requests entry at 1.11100. Its 20-pip stop requests 1.10900 under the five-decimal pip convention.

Measure the stop from the pending entry

Choose an order type, then change its stop distance. The stop is measured from the requested entry level.

EURUSD

Price levels · entry_pips=20

Market reference
1.10000
Illustrative quote
Buy limit entry
1.09800
20 pips below market
Requested stop
1.09300
50 pips below the pending entry

1.09800 − 0.00500 = 1.09300.

Five-decimal EURUSD example; entry_pips=20 and 1 pip = 0.00010. These are requested levels. Actual fills, costs and stop execution can change the outcome.

Calculated example; not an executed trade.

At market reference 1.10000, a buy limit 20 pips below market requests 1.09800. Its illustrated 50-pip stop requests 1.09300. Measuring that stop from market instead would give 1.09500, only 30 pips below entry. A sell’s SL is above its pending entry.

Confirm explicit pending-method compatibility on older EAs; release dates do not establish a minimum build.

Check accounts, then trades. One License ID can reach several accounts. Symbol commands select the exact broker symbol and stated direction. Magic Restriction determines whether management can include manual trades or other EAs. Supported comment= filters narrow the selection; omission can broaden it. Check what changed and what remained on every receiving account.

Command Requested scope
closelong Buy positions on the symbol.
closeshort Sell positions on the symbol.
closelongshort Both position directions on the symbol.
closeall Positions and pending orders across the receiving EA’s scope. Third field: receiving EA chart symbol. This does not restrict closure to that symbol.
Close all
Close all
TradingView → Message PineConnector Syntax
LicenseID,closeall,ChartSymbol

Replace ChartSymbol with the receiving EA’s actual chart symbol. Requests closure of positions and cancellation of pending orders across its scope.

Commands Quantity to close
closelongpct, closeshortpct Buy/sell volume using the EA’s Partial Close Percentage, not a percentage supplied in the message.
closelongvol, closeshortvol Buy/sell volume using required risk= as lots to close. This active exception is not entry-risk sizing; do not replace it with vol_lots=.
Partial buy close
Partial buy close
TradingView → Message PineConnector Syntax
LicenseID,closelongpct,EURUSD

If eligible buy volume is 0.04 lot and Partial Close Percentage is 25%, the requested reduction is 0.01 lot, leaving 0.03 if accepted. This illustration assumes 0.01-lot increments.

Close buy volume
Close buy volume
TradingView → Message PineConnector Syntax
LicenseID,closelongvol,EURUSD,risk=0.01

Requests a 0.01-lot reduction directly. Volume-close requests process available positions in order; an amount above available volume closes all available volume.

Exact ticket ordering, allocation and rounding between broker increments are unconfirmed; do not assume proportional reductions. Adding sl=0 requests conditional breakeven on the remainder.

Command Requested scope
cancellong Buy stops and buy limits on the symbol.
cancelshort Sell stops and sell limits on the symbol.
Cancel buy orders
Cancel buy orders
TradingView → Message PineConnector Syntax
LicenseID,cancellong,EURUSD

Cancels matching EURUSD buy pending orders. Already-open positions are outside this operation.

Command Requested change
newsltplong SL/TP on matching buy positions.
newsltpshort SL/TP on matching sell positions.

Include at least one stop or target, with one method per value. Absolute prices name the level directly. The reference price for pip/percentage modifications is unconfirmed here: check the installed EA’s rule, rather than borrowing an entry formula.

Buy stop and target
Buy stop and target
TradingView → Message PineConnector Syntax
LicenseID,newsltplong,EURUSD,sl_price=1.09800,tp_price=1.10400

Requests SL 1.09800 and TP 1.10400 on matching buys; entry and lot volume stay unchanged. Adapt levels to actual broker quotes and permitted distances.

Use sl=0, not sl_pips=0. The position must be in profit and far enough from entry for the broker to allow an entry-price stop. A rejected change can leave the old stop in place; inspect the result before retrying. This immediate request differs from automatic betrigger=/beoffset= management.

Buy breakeven
Buy breakeven
TradingView → Message PineConnector Syntax
LicenseID,newsltplong,EURUSD,sl=0

Requests SL at the matching buy’s entry price under those conditions. Check the actual stop and retained TP; entry and volume remain unchanged.

Command Pending orders whose SL/TP changes
newsltpbuystop Buy stops.
newsltpbuylimit Buy limits.
newsltpsellstop Sell stops.
newsltpselllimit Sell limits.

Include at least one stop or target. Relative pip/percentage SL/TP uses the pending entry, not current market. These commands leave the pending entry unchanged.

Buy-stop targets
Buy-stop targets
TradingView → Message PineConnector Syntax
LicenseID,newsltpbuystop,EURUSD,sl_pips=20,tp_pips=40

Requests a 20-pip SL below and 40-pip TP above each matching buy-stop entry. At entry 1.10200 with pip size 0.00010: SL 1.10000, TP 1.10600.

The close applies within scope; the new market entry needs volume and any required stop. Aliases are case-insensitive.

Command / alias Close → new entry
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.
Replace buys with a sell
Replace buys with a sell
TradingView → Message PineConnector Syntax
LicenseID,closelongopenshort,EURUSD,vol_lots=0.01,sl_pips=20

Requests closing matching buys, then a new 0.01-lot sell. Check both results; a combined message does not guarantee both actions complete.

The replacement needs one entry method, volume and any required stop.

Command Cancel → new pending order
cancellongbuystop Buy pending orders → buy stop.
cancellongbuylimit Buy pending orders → buy limit.
cancelshortsellstop Sell pending orders → sell stop.
cancelshortselllimit Sell pending orders → sell limit.
New buy stop
New buy stop
TradingView → Message PineConnector Syntax
LicenseID,cancellongbuystop,EURUSD,vol_lots=0.01,entry_pips=20,sl_pips=20

Requests cancellation of matching buy pending orders and a new buy stop. Inspect old orders and the replacement separately before deciding whether to retry.

Add these groups when opening an entry. They do not replace volume or an initial stop required for loss-based sizing. Breakeven and pip-trailing distances use PineConnector pips, regardless of legacy Target Type. ATR uses the units in its table. Test interactions before combining stop managers.

Parameter Unit and requirement
betrigger= Favourable movement in pips. Above zero; requires beoffset=.
beoffset= Stop offset from entry in pips. Requires betrigger=; smaller than its trigger. 0 requests entry price. Positive offsets are above a buy entry, below a sell entry.
Activate automatic breakeven
Activate automatic breakeven
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,betrigger=10,beoffset=2

From buy entry 1.10000 and pip size 0.00010: at +8 pips retain the initial stop; at +10 request SL 1.10020; at +14 the breakeven level stays 1.10020. Assumes accepted changes.

Broker distance rules can reject the change. Entry-price breakeven does not guarantee zero net loss after costs or execution differences.

Parameter Unit and requirement
trailtrig= Activation movement in pips. Requires traildist= and trailstep=. Negative can request immediate activation; zero can depend on spread coverage. Confirm these boundaries on your EA.
traildist= Distance from current price to trailing SL, in pips. Requires trailtrig= and trailstep=. Can add a stop on activation if none exists.
trailstep= Further favourable pips needed for each tightening. Requires trailtrig= and traildist=.

Buy SL trails below current price; sell SL trails above it. Fractional trailing values are rounded, but direction/tie handling is unconfirmed. The walkthrough uses positive whole numbers.

Start trailing after a gain
Start trailing after a gain
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,trailtrig=12,traildist=8,trailstep=3

Configures a 12-pip trigger, 8-pip distance and 3-pip step, starting with a 20-pip SL. The sequence below illustrates requested changes.

BUY example · step throughWatch a trailing stop move
  • Trigger · 12 pips
  • Distance · 8 pips
  • Step · 3 pips
Pips from entryExample price sequence →
Buy entry
1.100000 pips
Price
1.100000 pips
Stop request
1.09800−20 pips
1 / 6Start at entry

This example starts with sl_pips=20. The initial stop stays in place until trailing activates.

Initial stop: 1.10000 − 0.00200 = 1.09800.

Price from entryRequested SLWhat changes
0 pips · 1.100001.09800This example starts with sl_pips=20. The initial stop stays in place until trailing activates. Initial stop: 1.10000 − 0.00200 = 1.09800.
+8 pips · 1.100801.09800The move is still below the trigger. The initial stop is unchanged. +8 is below the +12-pip trigger.
+12 pips · 1.101201.10040Request the first trailing adjustment: move the stop to 8 pips behind this price. 12 − 8 = +4 pips above entry.
+14 pips · 1.101401.10040Price has moved another 2 pips. The 3-pip step has not been reached, so the stop stays put. 14 − 12 = 2 pips; the next step is at +15.
+15 pips · 1.101501.10070Price has gained another 3 pips since the last adjustment. Request a higher stop. 15 − 8 = +7 pips above entry.
+13 pips · 1.101301.10070The stop stays at +7. A pullback does not move it down to maintain the original distance. Stop remains +7 pips; it does not loosen to +5.

The stop moves towards profit, never away on a pullback. This example starts with a 20-pip SL and assumes the requested changes are accepted; spread and costs are omitted.

Illustrative prices · 1 pip = 0.00010 here. Real quotes and broker execution are not simulated.

Calculated example; not an executed trade.

ATR: convert the distance before placing the stop

Section titled “ATR: convert the distance before placing the stop”
Parameter Unit and requirement
atrtimeframe= Timeframe in minutes. Requires atrperiod=. MT4’s listed choices: 1, 5, 15, 30, 60, 240, 1440. Confirm other MT5 choices on your installed EA.
atrperiod= Number of ATR periods, such as 14. Requires atrtimeframe=.
atrmultiplier= Multiplier of ATR distance. Default 1. 2 doubles it.
atrshift= ATR bar offset. Default 0. Exact closed-bar mapping needs version confirmation.
atrtrigger= Favourable pip movement before activation. Default 0, described as immediate subject to initial-stop placement.

ATR uses broker MetaTrader data, which can differ from TradingView, and updates at each bar close of the selected timeframe. Candidate buy SL = current price − ATR × multiplier; sell SL = current price + that distance. Convert ATR in pips to price units first. The reference describes adding a stop if absent; loss-based sizing still needs an explicit initial stop. Confirm your build’s rule before replacing an already tighter stop with a wider ATR candidate.

Scale the ATR distance
Scale the ATR distance
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,atrtimeframe=60,atrperiod=14,atrmultiplier=2

Configures ATR trailing on 60-minute broker data with period 14 and multiplier 2. For a sample ATR distance of 7 pips, the candidate distance is 14 pips; this does not predict the broker’s ATR series or an accepted stop.

Parameter Meaning and limits
spread= Maximum entry spread in pips; decimals supported. At arrival, (Ask − Bid) ÷ pip size ≤ the limit passes this filter only. 2 admits 1.2 or 2 pips, not 3.8. Other checks still apply.
accfilter= Entry threshold under EA Account Filter Type/Basis: balance, equity, free margin (account currency) or margin percentage. 500 alone does not identify the metric. Equality/comparison is not confirmed for every setting; check the configured basis.
comment= Strategy label, up to 20 characters. Spaces are supported; avoid commas, which separate fields. Exact matching is documented for closelong, closeshort, cancellong, cancelshort; do not assume partial-close/other command support. Special characters and overlength handling need version confirmation. Supported entries and versions.
secret= Case-sensitive Signal Authentication key, required when enabled. Missing/different values prevent forwarding to the terminal. Saved License ID personalization does not supply it. Configure authentication. Never use a broker password or expose the real key in page copies/screenshots.
Limit the entry spread
Limit the entry spread
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,spread=2

Requests entry only when its arrival spread passes the 2-pip limit, alongside all other receiving checks.

Apply an account threshold
Apply an account threshold
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,accfilter=500

Passes threshold 500 to the configured account metric. The current metric and its comparison rule are needed to determine pass/fail.

Label a strategy
Label a strategy
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,comment=Strategy A

Labels the requested position Strategy A. Use the exact label with a supported comment-filtered closing or cancellation command.

Include authentication
Include authentication
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,secret=YOUR_SECRET_KEY

Replace YOUR_SECRET_KEY privately with the configured key when authentication is enabled. This placeholder is not an authenticated request.

Command Required third field and effect
eaoff eaoff: halt incoming signal processing; does not request position closure.
eaon eaon: resume a halted EA; does not request a new entry. Establish why it halted first.
closealleaoff Receiving EA’s chart symbol: close positions/cancel pending orders within scope, then halt.
Halt EA
Halt EA
TradingView → Message PineConnector Syntax
LicenseID,eaoff,eaoff

Requests that the receiving EA halt incoming signal processing. Use LicenseID,eaon,eaon to request resumption; these third fields are command words, not broker symbols.

Close and halt
Close and halt
TradingView → Message PineConnector Syntax
LicenseID,closealleaoff,ChartSymbol

Replace ChartSymbol with the receiving EA’s chart symbol. Check the final positions, pending orders and halted state separately on all receiving accounts.

Older alerts using risk=, sl=, tp= or pending=? See legacy syntax. Confirm the original units, receiving settings and version before changing them.

For every request, verify receipt, processing and the actual broker state. Follow the demo test workflow or troubleshoot a missing alert. Check existing orders before retrying an uncertain outcome.

Open the full-width cheatsheet for a compact desktop view. All commands, parameters and aliases are also visible below.

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

Older alerts only: risk= → Volume Type; sl=/tp= → Target Type; pending= → Pending Order Entry Type. Confirm Parameter Source, units and version. Legacy reference. Current risk=/sl=0 exceptions above; old aliases unconfirmed.

Uncertain outcome? Inspect existing orders before retrying. Verification guidance. Full-width view suits large screens; smaller screens scroll. A3 landscape print styles included.