PineConnector Syntax
Find a command or parameter, choose its units, then copy a complete example.
Message structure
Section titled “Message structure”Choose an action, then its values. PineConnector Syntax tells the receiving EA what to request.
Pine Script is the separate programming language that can generate these messages.
| Field | What goes here |
|---|---|
| LicenseID | The ID for your intended connection in Portal Connections. One ID can address several accounts. |
| Command | One action, such as buy, sell or closelong. |
| Symbol | The exact broker symbol, including suffix and letter case. EA controls can use a special third field. |
| Parameters | The values needed by that action, each written as name=value. |
- Keep the field order shown above, separated by commas. Spaces around commas are optional.
- Use one License ID, one command and one symbol per message.
- Keep explanations and alternative messages outside TradingView’s Message field.
Paste separately into TradingView's Webhook URL field.
Message examples
Section titled “Message examples”Try these on demo: paste into TradingView → Message. Replace LicenseID and the broker symbol; use permitted sizes and add your secret= if required.
One ID can reach several accounts. Check the intended accounts and the EA’s trade scope, then follow the demo test workflow.
Use explicit units such as vol_lots= and sl_pips= for new messages. Choose one method for each value. Explicit units take priority over corresponding setting-dependent inputs; they do not bypass other EA filters or broker rules.
Shared example rules
Section titled “Shared example rules”Use your broker’s values when adapting an example. These are illustrative values, not EA defaults or recommended trade settings:
- FX-5: EURUSD entry 1.10000, five decimals, quoting Point 0.00001, one PineConnector pip 0.00010.
- Account: USD 10,000 balance and 9,100 equity.
- Results: requests before broker handling, not executed trades. Any variation is stated beside the example.
Choose fields for an entry:
- One explicit volume method.
- At most one stop method and one target method.
- An explicit stop whenever you use loss-based sizing.
Omitted values: check the receiving EA settings. A missing parameter does not establish a numeric default; this page names a default only where the reference supplies one.
PineConnector pip
Section titled “PineConnector pip”One PineConnector pip = 10 symbol quoting points. Multiply a pip distance by that pip size to get a price distance. Point describes the quote; the broker’s tick size is the minimum tradable price change and can differ from Point.
| Teaching class | Quoting Point | One PineConnector pip | sl_pips=20 distance |
Illustrative buy SL |
|---|---|---|---|---|
| FX-5: five decimals, entry 1.10000 | 0.00001 | 0.00010 | 20 × 0.00010 = 0.00200 | 1.09800 |
| FX-3: three decimals, entry 150.000 | 0.001 | 0.010 | 20 × 0.010 = 0.200 | 149.800 |
| METAL-2: two decimals, entry 2000.00 | 0.01 | 0.10 | 20 × 0.10 = 2.00 | 1998.00 |
Calculated example; not an executed trade.
Use precision, not the asset name. Two-decimal index and crypto examples share the same pip size above. An asset name does not establish its broker precision.
Account currency does not change this price level when entry and pip size stay fixed. It matters for loss-based volume.
PineConnector uses 1 pip = 10 symbol points. Select an example to inspect the price calculation and decimal precision.
- Example entry
- 1.10000 5 decimal places
- 20-pip distance
- 0.00200 1 pip = 0.00010
- Stop loss (buy)
- 1.09800 Entry minus the distance
20 × 0.00010 = 0.00200 price units, or 0.1818% of this example entry.
These entry prices and decimal precisions are examples, not live quotes or a rule for every asset class. Check your broker’s symbol precision and minimum stop distance.
Calculated example; not an executed trade.
Read the example
Given: Five illustrative quotes/precisions; start with FX-5 buy at 1.10000. Only three precision classes are represented.
Alert: LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20
Result and why: At a five-decimal EURUSD entry of 1.10000, sl_pips=20 is a 0.00200 price distance and the buy stop is 1.09800. At a three-decimal JPY-pair entry of 150.000, the distance is 0.20 and the buy stop is 149.800.
At a two-decimal gold entry of 2000.00, the same input is a 2.00 price distance. The example index at 34000.00 and crypto at 60000.00 also use two decimals and a 2.00 distance. These distances represent different percentages of their entry prices.
The same PineConnector pip convention applies to pip-based stops, targets, entries, breakeven, trailing and spread. Broker precision can differ even for the same symbol. Point is a quoting point, not necessarily the minimum tradable price change (tick size).
Look up your symbol’s Point, tick size and stop constraints. The same pip convention applies to pip-based stops, targets, entries, breakeven, trailing, ATR triggers and spread.
Pending reference price
Section titled “Pending reference price”Calculate a pending entry offset from the market reference when the request arrives. Then calculate its pip/percentage SL and TP from the pending entry, including when modifying the targets of an existing pending order.
| Pending command | Pip entry formula | Percentage entry formula |
|---|---|---|
buystop, selllimit |
Market + entry_pips × pip | Market × (1 + entry_pct ÷ 100) |
buylimit, sellstop |
Market − entry_pips × pip | Market × (1 − entry_pct ÷ 100) |
Calculate entry first, then its stop
Section titled “Calculate entry first, then its stop”Given the FX-5 market reference 1.10000:
- Buy stop
entry_pips=20gives entry 1.10200. - Its
sl_pips=20gives SL 1.10000:1.10200 − 20 × 0.00010.
Wrong base: measuring the stop from market gives 1.09800, a different 40-pip distance from the pending entry. This contrasts calculations; it is not a second command to send.
Calculated example; not an executed trade. Bid/ask spread is omitted from the single market reference. Check the receiving account for actual quote side, fills and broker handling.
Existing-position relative modifications have a separate reference-price limit.
Loss-based sizing
Section titled “Loss-based sizing”Lots = planned loss budget ÷ (stop distance in pips × pip value per 1.00 lot), before broker volume rounding. A stop stated as a price or percentage first gives a price distance from the applicable entry; divide that distance by the symbol’s PineConnector pip size.
| Method | Budget in account currency |
|---|---|
vol_dollar= |
Supplied cash amount |
vol_pct_bal_loss= |
Balance × message percentage ÷ 100 |
vol_pct_eq_loss= |
Equity × message percentage ÷ 100 |
Same budget, different stop distances
Section titled “Same budget, different stop distances”Given FX-5, vol_dollar=100, a 100,000 EUR contract and USD 10 per pip per 1.00 lot:
| Stop choice | Distance in pips | Lots before broker volume rounding |
|---|---|---|
sl_pips=20 |
20 | 100 ÷ (20 × 10) = 0.50 |
| Exact stop 1.09500 | (1.10000 − 1.09500) ÷ 0.00010 = 50 | 100 ÷ (50 × 10) = 0.20 |
| 1% stop | 0.01100 ÷ 0.00010 = 110 | 100 ÷ (110 × 10) ≈ 0.090909 |
Calculated example; not an executed trade. USD 10 is a scenario assumption, not a universal pip value. Look up your broker’s contract, tick-value and currency details.
Costs, fills, gaps and broker limits can make actual loss differ from the sizing input.
Do not guess the rounded volume
Section titled “Do not guess the rounded volume”With equity 9,100, a 1% budget is 91. The same 20-pip stop gives 91 ÷ (20 × 10) = 0.455 lots before rounding.
On an illustrative 0.01 volume step, that lies between 0.45 and 0.46. The EA’s rounding direction is not established here. Check the requested and accepted volume rather than choosing either by assumption.
Check accounts first, then trades. A License ID can address several accounts. Neither a symbol nor a comment proves there is only one recipient.
- Symbol commands: use the exact broker symbol, including case and suffix.
closeall/closealleaoff: use the receiving EA’s chart symbol as the third field. They can affect other symbols within scope.- Magic Restriction: check this EA setting to determine whether management can include manual trades and other EAs.
comment=: a supported filter narrows management to the exact strategy label. Omitting it can broaden the request.eaoff/eaon: use their own command word as the third field.
One ID, two receiving accounts
Section titled “One ID, two receiving accounts”Given: each demo account has a matching EA buy and sell on EURUSD, plus a manual EURUSD buy. Magic Restriction limits management to matching EA positions.
Result: the message below requests closure of matching EA buys on both accounts. Matching sells and manual buys stay outside that selection. Illustrative request; not an executed trade.
Why: closelong selects buys, EURUSD selects the symbol, Magic Restriction limits eligible positions, and the shared ID supplies both recipients.
Changing only the command changes the selection:
closeshort: matching sells.cancellong: pending buy orders; these open positions are outside the operation.
No request here establishes an actual close.
Illustrative request; not an executed trade. For an EA-wide closeall, replace its third-field ChartSymbol with the receiving EA chart symbol; that field does not limit management to that symbol. See the complete close reference rows.
Before closing, cancelling or modifying, look up the receiving accounts and settings. Afterwards check both what changed and what remained. Command tables state the requested scope, not a list of tickets known to exist in your account.
Look up broker values
Section titled “Look up broker values”- Open Market Watch, right-click the receiving broker’s exact symbol (including suffix), then choose Specification.
- Record Digits, Stops level (points), minimum/maximum volume and Volume step.
- Obtain Point, tick size, tick value and its currency, contract size and contract/quote currency from the same MT5 specification. Ask the broker for any field missing from your terminal view.
- Compare your request with those limits: Stops level × Point gives the minimum stop distance; tick size separately governs price increments. Volume must meet minimum, maximum and step rules. The EA’s rounding policy is separate.
No terminal access on Edge? Request the same broker MT5 symbol specification through the broker or support. Include broker/server and exact symbol. Keep credentials and keys private.
Point and tick size do different jobs
Section titled “Point and tick size do different jobs”With Stops level 20 points and Point 0.00001, minimum distance is 20 × 0.00001 = 0.00020. A tick size of 0.00005 independently controls price increments.
Do not substitute tick size for Point or infer a USD pip value from an asset name. A displayed zero stop level does not prove every stop will be accepted.
Calculated example; not an executed trade. The 20-point stop level and 0.00005 tick size above are a lookup illustration, not limits for the FX-5 fixture or your broker.
MetaTrader Specification · MetaQuotes symbol properties.
Look up account and EA values
Section titled “Look up account and EA values”- In Portal Connections, check the intended ID and all receiving accounts.
- Read current balance, equity, account currency, free margin and margin level in the receiving terminal/account view. Without hosted access, request them through broker/support. An old screenshot does not establish values at arrival.
- Open the receiving EA’s Inputs. Check Magic Restriction, Partial Close Percentage and Account Filter Type. For legacy messages also check Volume Type, Target Type, Pending Order Entry Type and Parameter Source where applicable.
- For pending/modification calculations, inspect actual pending or position entry and current broker bid/ask. For ATR, match the broker MetaTrader symbol, timeframe, lookback and bar offset.
Settings unavailable? Ask support to confirm the receiving configuration. An alert’s numeric value does not identify an EA setting.
Not supplied here: broker ATR series, exact build-specific shift mapping or an EA rounding rule.
Explicit and legacy units
Section titled “Explicit and legacy units”Prefer explicit units for new messages. vol_lots=0.01 requests 0.01 lot. Generic risk=0.01 needs the EA’s legacy Volume Type to identify a size.
Their volume interpretation matches only when Volume Type is Lots and legacy Parameter Source uses message values. This comparison does not permit mixing volume methods.
Explicit units take priority over corresponding setting-dependent inputs. Authentication, account filters, scope and broker rules still apply. Confirm compatibility before changing an older setup.
Release history and older alerts
The recorded milestones are 18 December 2025 for explicit units and 27 January 2026 for expanded explicit pending methods. These dates do not identify the minimum compatible EA build.
Volume
Section titled “Volume”Choose how to size the trade. Use one volume method for each entry.
A loss budget needs a stop distance. Margin allocation is a separate calculation.
| Choose one | Use when you want… |
|---|---|
1. vol_lots= |
A fixed number of lots. |
2. vol_dollar= |
A planned cash loss at the stop. |
3. vol_pct_bal_loss= |
A planned loss based on balance. |
4. vol_pct_eq_loss= |
A planned loss based on equity. |
5. vol_pct_bal_margin= |
A percentage of balance allocated as margin. |
vol_lots=
Section titled “vol_lots=”Request a fixed lot size. 0.01 means 0.01 lot, not 1% risk. Check the broker’s minimum, maximum and lot increment.
Given: Fixed quantity
Result: Illustrative; trade not executed 0.01 lot requested; buy SL 1.09800.
Why: The supplied 0.01 lot passes through as a quantity; stop distance does not convert it into account-risk sizing.
Lot minimum, maximum and volume step come from the broker specification.
vol_dollar=
Section titled “vol_dollar=”vol_dollar=100 sizes the trade for a planned loss of about 100 at the stop, in account currency: USD 100 on the illustrative USD account.
Add one stop: sl_pips=, sl_price= or sl_pct=.
Volume uses the stop distance and broker details. Actual loss can differ with execution, costs and broker limits.
Given: USD account; planned cash loss USD 100; FX-5; stop 20 pips; USD 10 per pip per 1.00 lot.
| Example | Alert message |
|---|---|
| 1Pips | Result: Calculated; trade not executed FX-5 buy SL 1.09800; calculated volume 0.50 lots before broker volume rounding. |
| 2Price | Result: Calculated; trade not executed FX-5 buy SL 1.09500; calculated volume 0.20 lots before broker volume rounding. |
| 3Percentage | Result: Calculated; trade not executed FX-5 buy SL 1.08900; calculated volume ≈0.090909 lots before broker volume rounding. |
Why: 100 (message cash budget) ÷ [20 (message stop pips) × 10 (fixture USD per pip per lot)] = 0.50 lots.
The USD 10 pip value assumes a USD account and a 100,000 EUR contract. Actual loss can differ with execution and costs.
Keep the planned loss at USD 100. Change the stop distance and see how the calculated lot size changes.
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.
Read the example
Given: FX-5 EURUSD buy at 1.10000; USD account, 100,000 EUR contract; pip value USD 10 per 1.00 lot.
Alert: LicenseID,buy,EURUSD,vol_dollar=100,sl_pips=20
Result and why: With vol_dollar=100 and a 20-pip stop, this example gives 100 ÷ (20 × 10) = 0.50 lots. A 40-pip stop gives 0.25 lots; an 80-pip stop gives 0.125 lots before broker rounding.
The cash budget stays the same while the stop distance changes the calculated size. Loss-based volume needs one explicit stop method in the same message: sl_pips=, sl_price= or sl_pct=.
vol_pct_bal_loss=
Section titled “vol_pct_bal_loss=”Size the trade for a planned loss based on account balance. 1 means 1%: on a 10,000 balance, that is 100 in account currency at the chosen stop.
Include one explicit stop method. Use the shared loss-based sizing formula; this budget is not the amount of margin used.
Given: USD balance 10,000; FX-5 sell; 20-pip stop; USD 10 per pip per lot.
Result: Calculated; trade not executed USD 100 planned loss budget; 0.50 lots before broker volume rounding; sell SL 1.10200.
Why: 10,000 (fixture balance) × 1 ÷ 100 (message percentage) = USD 100; 100 ÷ (20 × 10) = 0.50 lots.
USD account, 100,000 EUR contract and the stated pip value; requested size, not actual loss.
vol_pct_eq_loss=
Section titled “vol_pct_eq_loss=”Use account equity for the planned loss calculation. Equity includes floating profit or loss, so it can differ from balance. 1 means 1% of equity.
Include one explicit stop method and the shared loss-based sizing formula. Actual loss can differ from the planned amount.
Given: USD equity 9,100; FX-5 buy; 20-pip stop; USD 10 per pip per lot.
Result: Calculated; trade not executed USD 91 planned loss budget; 0.455 lots before broker volume rounding; buy SL 1.09800.
Why: 9,100 (fixture equity) × 1 ÷ 100 (message percentage) = USD 91; 91 ÷ (20 × 10) = 0.455 lots.
USD account and 100,000 EUR contract. The 0.01 illustrative volume step does not establish whether the EA rounds to 0.45 or 0.46.
vol_pct_bal_margin=
Section titled “vol_pct_bal_margin=”Allocate a percentage of balance as margin. 5 means 5% of balance used as margin.
- This does not limit loss to 5%.
- Stop distance is not used for this volume calculation.
Given: USD balance 10,000.
Result: Calculated; trade not executed USD 500 margin allocation; not a USD 500 loss limit. The resulting lots need the broker margin calculation.
Why: 10,000 (fixture balance) × 5 ÷ 100 (message percentage) = USD 500 allocated as margin.
Leverage, symbol margin requirements, account currency and broker volume limits are needed to determine lots.
Move through an example account with open floating profit or loss. Compare the budgets for a new entry at each snapshot.
Account snapshots
- 1% of balance
- USD 100 vol_pct_bal_loss=1 · needs SL
- 1% of equity
- USD 91 vol_pct_eq_loss=1 · needs SL
- 5% as margin
- USD 500 vol_pct_bal_margin=5 · uses balance
Equity USD 9,100 = balance USD 10,000 − USD 900 floating loss. The margin budget is not a loss limit.
Illustrative USD account, with no deposits, withdrawals or closed trades between snapshots. These are new-entry budgets, not changes to an existing position’s size.
Calculated example; not an executed trade.
Read the example
Given: USD balance 10,000; equity 9,100; compare new-entry loss budgets, with a 20-pip stop.
Alert: LicenseID,buy,EURUSD,vol_pct_eq_loss=1,sl_pips=20
Result and why: At a balance of USD 10,000 and equity of USD 9,100, vol_pct_bal_loss=1 gives a USD 100 planned loss budget; vol_pct_eq_loss=1 gives USD 91. Both need an explicit stop.
vol_pct_bal_margin=5 also uses balance: its margin budget is USD 500 in this example. It does not use stop distance and does not cap the trade’s loss at USD 500.
Stop loss
Section titled “Stop loss”Choose one method when opening a trade. A buy stop loss is below the applicable entry; a sell stop loss is above it.
sl_pips=2020 × 0.00010 = 0.00200 price distancesl_price=1.09500Use the supplied level. No conversion.sl_pct=11.10000 × 1% = 0.01100 price distanceFrom 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.
sl_pips=
Section titled “sl_pips=”Set the stop distance in PineConnector pips. Convert the message value to a price distance using the broker symbol’s pip size.
| Direction | Requested SL |
|---|---|
| Buy | Entry − sl_pips × pip |
| Sell | Entry + sl_pips × pip |
Given: FX-5 EURUSD, illustrative entry 1.10000; 1 pip = 0.00010. Buy; 0.01 lot.
Result: Calculated; trade not executed Buy SL requested at 1.09800.
Why: 20 (message pips) × 0.00010 (fixture pip size) = 0.00200 distance; 1.10000 (fixture entry) − 0.00200 = 1.09800.
Requested levels only; the broker must accept price and volume increments and minimum distances.
sl_price=
Section titled “sl_price=”Set the exact stop price. sl_price=1.09500 requests 1.09500; there is no pip or percentage calculation.
Check the correct side of entry, broker tick size and minimum stop distance. A price from TradingView can be invalid at the broker.
Given: FX-5 EURUSD, illustrative buy entry 1.10000; 0.01 lot.
Result: Illustrative; trade not executed Buy SL requested at 1.09500, exactly the supplied price.
Why: The supplied price passes through unchanged; its side, tick increment and broker distance determine validity.
No unit conversion. The stop must be below the buy reference, align to the broker tick size and satisfy the minimum stop distance.
sl_pct=
Section titled “sl_pct=”Set the stop distance as a percentage of entry price. 1 means 1% of that price; it does not set 1% account risk.
| Direction | Requested SL |
|---|---|
| Buy | Entry × (1 − sl_pct ÷ 100) |
| Sell | Entry × (1 + sl_pct ÷ 100) |
Given: FX-5 EURUSD, illustrative buy entry 1.10000; 0.01 lot.
Result: Calculated; trade not executed Buy SL requested at 1.08900.
Why: 1.10000 (fixture entry) × (1 ÷ 100) (message percentage) = 0.01100 distance; 1.10000 − 0.01100 = 1.08900.
The base is entry price, not account balance. Requested level only; broker constraints apply.
Before using a stop method:
- For a pending order, use its pending entry as the reference.
- Any of these methods can supply the distance for loss-based sizing.
- Choose one method. Explicit units override corresponding legacy fields; broker constraints still apply.
Opening and modifying differ. The formulas above cover entries. Existing-position modifications have a separate rule.
For manual breakeven, use its special command. sl_pips=0 is not a documented substitute; zero, negative and fractional explicit-stop handling are not established here.
Take profit
Section titled “Take profit”Where should profit be taken? Choose one method if you include a target. A buy target is above entry; a sell target is below it.
tp_pips=
Section titled “tp_pips=”Set the target distance in PineConnector pips, from the applicable entry.
| Direction | Requested TP |
|---|---|
| Buy | Entry + tp_pips × pip |
| Sell | Entry − tp_pips × pip |
Given: FX-5 EURUSD, illustrative entry 1.10000; 1 pip = 0.00010. Buy; 0.01 lot.
Result: Calculated; trade not executed TP requested at 1.10400; SL at 1.09800.
Why: 40 (message target pips) × 0.00010 (fixture pip) = 0.00400; 1.10000 + 0.00400 = 1.10400.
Requested levels only; the broker must accept price and volume increments and minimum distances.
- SL · 20 pips
- TP · 40 pips
- Take profit1.10400+40 pips
- Buy entry1.10000
- Stop loss1.09800−20 pips
20 pips = 0.00200 below entry. 40 pips = 0.00400 above entry.
A sell reverses the stop and target directions.
Illustrative prices · 1 pip = 0.00010 here. Real quotes and broker execution are not simulated.
Calculated example; not an executed trade.
tp_price=
Section titled “tp_price=”Set an exact target price, such as 1.10400. Check the correct side of entry and the broker’s distance rules.
Given: FX-5 EURUSD, illustrative buy entry 1.10000; 0.01 lot.
Result: Illustrative; trade not executed TP requested at 1.10400; SL at the supplied 1.09800.
Why: The supplied target price passes through unchanged; its side, tick increment and broker distance determine validity.
Exact prices pass through. The target must be above the buy reference and satisfy broker tick size and distance rules.
tp_pct=
Section titled “tp_pct=”Set a percentage distance from entry. 2 means 2%.
| Direction | Calculation |
|---|---|
| Buy | Entry × (1 + percentage ÷ 100) |
| Sell | Entry × (1 − percentage ÷ 100) |
Given: FX-5 EURUSD, illustrative buy entry 1.10000; 0.01 lot.
Result: Calculated; trade not executed TP requested at 1.12200; 1% SL at 1.08900.
Why: 1.10000 (fixture entry) × 2 ÷ 100 (message target percentage) = 0.02200; 1.10000 + 0.02200 = 1.12200.
Percentages use entry price; requested levels only, subject to broker constraints.
Pending targets use the pending entry reference. All target methods remain subject to broker constraints; modifying open positions is a separate operation.
Open orders
Section titled “Open orders”Market commands
Section titled “Market commands”Use buy or sell for a market entry. Include one volume method and any stop it requires.
| Command | Action | Accepted aliases |
|---|---|---|
buy |
Request a buy at market. | long, bull, bullish |
sell |
Request a sell at market. | short, bear, bearish |
Aliases are case-insensitive.
| Example | Alert message |
|---|---|
| 1Buy | Result: Calculated; trade not executed Requests 0.01 lot; buy SL 1.09800 and TP 1.10400, using FX-5 entry 1.10000. |
| 2Sell | Result: Calculated; trade not executed Requests 0.01 lot; sell SL 1.10200 and TP 1.09600, using FX-5 entry 1.10000. |
Pending commands
Section titled “Pending commands”Choose the order type by its side of market. Every pending order needs one entry method, one volume method and any stop required for sizing.
| Command | Entry level | Use when… |
|---|---|---|
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. |
buy and sell are market commands, not substitutes for pending commands.
| Example | Alert message |
|---|---|
| 1Buy stop | Result: Calculated; trade not executed Requests 0.01 lot; entry 1.10200, SL 1.10000, TP 1.10600. Market reference 1.10000; FX-5 pip 0.00010. |
| 2Buy limit | Result: Calculated; trade not executed Requests 0.01 lot; entry 1.09800, SL 1.09600, TP 1.10200. Market reference 1.10000; FX-5 pip 0.00010. |
| 3Sell stop | Result: Calculated; trade not executed Requests 0.01 lot; entry 1.09800, SL 1.10000, TP 1.09400. Market reference 1.10000; FX-5 pip 0.00010. |
| 4Sell limit | Result: Calculated; trade not executed Requests 0.01 lot; entry 1.10200, SL 1.10400, TP 1.09800. Market reference 1.10000; FX-5 pip 0.00010. |
entry_pips=
Section titled “entry_pips=”Set the pending entry a positive PineConnector pip distance from the current market reference. The command determines the direction: use the four pending formulas and reference rule.
Given: FX-5; market reference 1.10000; buy stop; 0.01 lot.
Result: Calculated; trade not executed Pending entry requested at 1.10200; SL at 1.10000.
Why: 20 (message entry pips) × 0.00010 (fixture pip) = 0.00200; entry = 1.10000 + 0.00200. SL = 1.10200 − (20 × 0.00010) = 1.10000.
Single illustrative market reference; bid/ask spread omitted. Pending fill and stop execution can differ.
entry_price=
Section titled “entry_price=”Set an absolute entry price. Choose the correct side of the market and meet the broker’s tick size and minimum distance; the supplied price passes through.
Given: FX-5; market reference 1.10000; buy limit; 0.01 lot.
Result: Calculated; trade not executed Pending entry requested at the supplied 1.09500; SL at 1.09300.
Why: Entry passes through; the companion stop is 1.09500 − (20 × 0.00010) = 1.09300.
Entry must be below the current market for this buy limit and meet broker tick size and minimum distance.
entry_pct=
Section titled “entry_pct=”Set a percentage distance from the current market reference. 1 means 1%. Use a positive value and the command-specific formula.
Pending stop/target distances use the pending entry, not the market price when the message arrives. Explicit pending methods were introduced in the published 27 January 2026 update; check compatibility before using them on an older EA.
Given: FX-5; market reference 1.10000; buy stop; 0.01 lot.
Result: Calculated; trade not executed Pending entry requested at 1.11100; raw SL 1.105445 before broker price precision or tick-size handling.
Why: 1.10000 × 1 ÷ 100 = 0.01100; entry = 1.11100. Stop distance = 1.11100 × 0.5 ÷ 100 = 0.005555; SL = 1.11100 − 0.005555 = 1.105445.
Entry percentage uses market reference; stop percentage uses pending entry. The exact broker-accepted SL is not determined without price handling rules.
Choose an order type, then change its stop distance. The stop is measured from the requested entry level.
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.
Read the example
Given: FX-5 market reference 1.10000; buy limit 20 pips below market; deliberately varied 50-pip stop.
Alert: LicenseID,buylimit,EURUSD,vol_lots=0.01,entry_pips=20,sl_pips=50
Result and why: With market reference 1.10000, buylimit and entry_pips=20 request entry at 1.09800. Adding sl_pips=50 requests the stop at 1.09300: 50 pips below that pending entry.
Measuring 50 pips from the current market would instead give 1.09500, only 30 pips below the requested buy-limit entry. For a sell, the stop is above the requested entry.
Close, cancel and modify
Section titled “Close, cancel and modify”Start with what should change. Close open positions, cancel pending orders, or modify their stops and targets.
Check the receiving accounts and eligible trades before choosing a command.
Close positions
Section titled “Close positions”| Command | Request |
|---|---|
closelong |
Close buys for the symbol. |
closeshort |
Close sells for the symbol. |
closelongshort |
Close both directions for the symbol. |
closeall |
Close positions and cancel pending orders across the receiving EA’s scope. Use its chart symbol as the third field. |
For strategy-specific closing, read the comment= matching rules. Omitting a comment can broaden the request.
Choose the intended scope. Replace ChartSymbol with the receiving EA’s chart before using closeall.
| Example | Alert message |
|---|---|
| 1Close buys | Result: Illustrative; trade not executed Requests closure of matching EURUSD buys; sells are outside this direction selection. |
| 2Close sells | Result: Illustrative; trade not executed Requests closure of matching EURUSD sells; buys are outside this direction selection. |
| 3Close both | Result: Illustrative; trade not executed Requests closure of both EURUSD directions within scope. |
| 4Close all | Result: Illustrative; trade not executed Replace ChartSymbol with the chart symbol of the receiving EA. This is not limited to positions on that one symbol. Requests closure of positions and cancellation of pending orders across the receiving EA scope. |
Partial closes
Section titled “Partial closes”| Commands | Size to close |
|---|---|
closelongpct, closeshortpct |
The Partial Close Percentage selected in the EA. |
closelongvol, closeshortvol |
The lot volume supplied through risk=, required here. It is a close-volume amount, not entry-risk interpretation. |
Volume-close requests process available positions in order until the requested amount is reached.
- Above the available amount: close all available volume; a position does not become negative.
- Check actual tickets, broker increments and remaining volume. Do not assume proportional reductions.
Adding sl=0 can request breakeven for the remaining positions after the partial close. The profit and broker-distance conditions below still apply.
Calculate the close amount
Section titled “Calculate the close amount”Given: 0.04 lot of eligible EURUSD buys; EA Partial Close Percentage = 25%.
closelongpct:0.04 × 25 ÷ 100 = 0.01 lotto close, leaving 0.03 lot if accepted.closelongvolwithrisk=0.01: names that close amount directly. Hererisk=means lots to close, not entry risk.
Sell commands apply the same quantity rule to eligible sells.
Calculated example; not an executed trade. This separate position-volume fixture assumes the broker permits 0.01-lot increments. It does not establish per-ticket allocation or rounding when the calculated amount falls between increments.
These examples close buys or sells on EURUSD within the EA’s scope. Broker volume increments still apply.
| Example | Alert message |
|---|---|
| 1Partial buy close | Result: Illustrative; trade not executed Requests the EA-selected Partial Close Percentage of matching buy volume; the number of lots needs that setting. |
| 2Partial sell close | Result: Illustrative; trade not executed Requests the EA-selected Partial Close Percentage of matching sell volume; the number of lots needs that setting. |
| 3Partial close and breakeven | Result: Illustrative; trade not executed Requests the EA-selected Partial Close Percentage of matching buy volume; the number of lots needs that setting. Also requests conditional breakeven on the remainder. |
| 4Close buy volume | Result: Illustrative; trade not executed Requests closure of 0.01 lot of matching buy volume, subject to available volume and broker increments. |
| 5Close sell volume | Result: Illustrative; trade not executed Requests closure of 0.01 lot of matching sell volume, subject to available volume and broker increments. |
Cancel pending orders
Section titled “Cancel pending orders”| Command | Request |
|---|---|
cancellong |
Cancel the symbol’s buy stops and buy limits. |
cancelshort |
Cancel the symbol’s sell stops and sell limits. |
These cancel pending orders. Use a closing command after a position has opened.
| Example | Alert message |
|---|---|
| 1Cancel buy orders | Result: Illustrative; trade not executed Requests cancellation of matching buy stops and buy limits; open positions remain outside this operation. |
| 2Cancel sell orders | Result: Illustrative; trade not executed Requests cancellation of matching sell stops and sell limits; open positions remain outside this operation. |
Modify open positions
Section titled “Modify open positions”newsltplong changes buy-position SL/TP; newsltpshort changes sell-position SL/TP. Include at least one stop or target and choose one method for each.
Exact prices: the examples below name the requested level directly.
Pip/percentage methods: their reference price for open-position modifications is not established here. Confirm the installed EA’s rule first; do not borrow the opening-entry formula.
Illustrative levels assume EURUSD near 1.10000. Adjust them to the actual entry, current broker quote and permitted stop distance.
| Example | Alert message |
|---|---|
| 1Buy stop and target | Result: Illustrative; trade not executed Requests the supplied SL/TP on matching buy positions. It does not change their entry or lot volume; broker constraints apply. |
| 2Sell stop and target | Result: Illustrative; trade not executed Requests the supplied SL/TP on matching sell positions. It does not change their entry or lot volume; broker constraints apply. |
Manual breakeven
Section titled “Manual breakeven”Use the special value sl=0, not sl_pips=0. The position must be in profit and far enough from entry for the broker to permit the new stop. A rejected modification can leave the old stop unchanged; inspect the result before retrying.
Given: a matching profitable position entered at 1.10000, with enough current broker distance for an entry-price stop.
Result: request SL 1.10000 for a buy or sell; entry and volume stay unchanged. Illustrative request; not an executed trade.
Why: sl=0 names entry price, not a pip distance. Inspect the retained TP and actual stop after the request.
A position outside the profit/distance conditions is not a successful breakeven example.
| Example | Alert message |
|---|---|
| 1Buy breakeven | Result: Illustrative; trade not executed Requests SL at entry on matching buy positions; profit and broker-distance conditions apply. A rejected change can leave the old SL. |
| 2Sell breakeven | Result: Illustrative; trade not executed Requests SL at entry on matching sell positions; profit and broker-distance conditions apply. A rejected change can leave the old SL. |
Modify pending orders
Section titled “Modify pending orders”| Command | Orders whose SL/TP is changed |
|---|---|
newsltpbuystop |
Buy stops |
newsltpbuylimit |
Buy limits |
newsltpsellstop |
Sell stops |
newsltpselllimit |
Sell limits |
Include at least one stop or target. Explicit pip/percentage distances use the pending entry price. These commands change targets; they do not replace the pending entry itself.
| Example | Alert message |
|---|---|
| 1Buy-stop targets | Result: Illustrative; trade not executed Requests a 20-pip SL and 40-pip TP from the existing pending entry, leaving that entry and volume unchanged. Check matching orders within scope. |
| 2Buy-limit targets | Result: Illustrative; trade not executed Requests a 20-pip SL and 40-pip TP from the existing pending entry, leaving that entry and volume unchanged. Check matching orders within scope. |
| 3Sell-stop targets | Result: Illustrative; trade not executed Requests a 20-pip SL and 40-pip TP from the existing pending entry, leaving that entry and volume unchanged. Check matching orders within scope. |
| 4Sell-limit targets | Result: Illustrative; trade not executed Requests a 20-pip SL and 40-pip TP from the existing pending entry, leaving that entry and volume unchanged. Check matching orders within scope. |
Combined close and open
Section titled “Combined close and open”| Command | Alias | Close → new market 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 |
Provide volume for the new entry and a stop if that volume method requires one. Check both results; a combined message is not a guarantee that both actions complete.
| Example | Alert message |
|---|---|
| 1Replace buys with a buy | Result: Illustrative; trade not executed Requests the listed close followed by a new 0.01-lot buy with a 20-pip SL. Check each result separately; completion of both is not guaranteed. |
| 2Replace buys with a sell | Result: Illustrative; trade not executed Requests the listed close followed by a new 0.01-lot sell with a 20-pip SL. Check each result separately; completion of both is not guaranteed. |
| 3Replace sells with a buy | Result: Illustrative; trade not executed Requests the listed close followed by a new 0.01-lot buy with a 20-pip SL. Check each result separately; completion of both is not guaranteed. |
| 4Replace sells with a sell | Result: Illustrative; trade not executed Requests the listed close followed by a new 0.01-lot sell with a 20-pip SL. Check each result separately; completion of both is not guaranteed. |
| 5Replace both with a buy | Result: Illustrative; trade not executed Requests the listed close followed by a new 0.01-lot buy with a 20-pip SL. Check each result separately; completion of both is not guaranteed. |
| 6Replace both with a sell | Result: Illustrative; trade not executed Requests the listed close followed by a new 0.01-lot sell with a 20-pip SL. Check each result separately; completion of both is not guaranteed. |
Cancel and replace
Section titled “Cancel and replace”| 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 |
The replacement needs entry and volume, plus any required stop. Review the existing orders and the new order separately before retrying.
| Example | Alert message |
|---|---|
| 1New buy stop | Result: Illustrative; trade not executed Requests the listed cancellation followed by a new 0.01-lot buystop 20 pips from market, with SL 20 pips from its entry. Check cancellation and replacement separately. |
| 2New buy limit | Result: Illustrative; trade not executed Requests the listed cancellation followed by a new 0.01-lot buylimit 20 pips from market, with SL 20 pips from its entry. Check cancellation and replacement separately. |
| 3New sell stop | Result: Illustrative; trade not executed Requests the listed cancellation followed by a new 0.01-lot sellstop 20 pips from market, with SL 20 pips from its entry. Check cancellation and replacement separately. |
| 4New sell limit | Result: Illustrative; trade not executed Requests the listed cancellation followed by a new 0.01-lot selllimit 20 pips from market, with SL 20 pips from its entry. Check cancellation and replacement separately. |
Breakeven and trailing stops
Section titled “Breakeven and trailing stops”These parameters configure later stop changes when opening an entry. They do not replace its volume or any initial stop required for loss-based sizing.
Automatic breakeven: move the stop once
Section titled “Automatic breakeven: move the stop once”Use the shared pip size for these offsets.
| Direction | Trigger price | Requested SL after trigger |
|---|---|---|
| Buy | Entry + betrigger × pip | Entry + beoffset × pip |
| Sell | Entry − betrigger × pip | Entry − beoffset × pip |
| Buy path from 1.10000, trigger 10, offset 2 | Requested SL |
|---|---|
| +8 pips: below trigger | Retain initial 1.09800 |
| +10 pips: trigger reached | 1.10000 + 2 × 0.00010 = 1.10020 |
| +14 pips: further rise | Keep fixed entry-relative 1.10020 |
Calculated example; not an executed trade. The sequence assumes accepted changes and omits costs; it does not simulate combined stop-management features.
betrigger=
Section titled “betrigger=”The favourable movement in pips before automatic breakeven activates. Must be above zero; include beoffset= too.
Given: FX-5 EURUSD, illustrative entry 1.10000; 1 pip = 0.00010. Buy; initial SL 1.09800.
Result: Calculated; trade not executed At a 10-pip favourable move, request SL 1.10020.
Why: Trigger price = 1.10000 + (10 × 0.00010) = 1.10100; SL = 1.10000 + (2 × 0.00010) = 1.10020.
Assumes the broker accepts the change. A trigger observation is not a fill; spread and costs are omitted.
beoffset=
Section titled “beoffset=”Where to place the stop relative to entry after the trigger. Keep it smaller than betrigger=. 0 requests entry price; 2 protects two pips above a buy entry or below a sell entry.
A breakeven price is not a guarantee of zero net loss after costs or execution differences. Broker rules can reject the modification.
Given: FX-5 EURUSD, illustrative entry 1.10000; 1 pip = 0.00010. Buy; trigger 10 pips.
Result: Illustrative; trade not executed After the trigger, request SL at entry +2 pips: 1.10020; the offset stays entry-relative.
See the shared breakeven sequence and formula. Offset must be below trigger; broker acceptance is separate.
Choose the gain that activates breakeven and the level to request. Further gains do not increase that fixed breakeven level.
Example price path
- Activation gain
- +10 pips betrigger=
- Stop from entry
- +2 pips beoffset=
- Offset check
- Below trigger 2 < 10
At a +10-pip gain, request the stop at entry +2 pips. The breakeven level stays fixed as this price path continues.
Buy example with an initial 20-pip stop. The drawing assumes requested changes are accepted and omits spread and costs. It does not model stop execution or combined stop-management features.
Calculated example; not an executed trade.
Read the example
Given: FX-5 buy at 1.10000; one pip 0.00010; initial SL 1.09800.
Alert: LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,betrigger=10,beoffset=2
Result and why: With betrigger=10 and beoffset=2, a 10-pip favourable move requests the stop 2 pips above the buy entry. At entry 1.10000, that is 1.10020. The breakeven target stays at that entry-relative level.
The trigger must be above zero and the offset must be below the trigger. beoffset=0 requests the entry price; this is not a guarantee of zero net loss after costs or execution differences.
The optional comparison uses the same trigger with traildist=8 and trailstep=3. Unlike the fixed breakeven level, its illustrated stop advances after further favourable steps.
Pip trailing: tighten in steps
Section titled “Pip trailing: tighten in steps”For positive whole-number inputs, using the shared pip size:
| Direction | Illustrated stop |
|---|---|
| Buy | Current price − traildist × pip |
| Sell | Current price + traildist × pip |
After the trigger, each further favourable trailstep permits another tightening. The illustrated stop does not loosen on a pullback; see the complete sequence below.
trailtrig=
Section titled “trailtrig=”Set the movement before pip trailing activates. Include both traildist= and trailstep=.
- Positive: the worked sequence below uses this path.
- Negative: can request immediate activation.
- Zero: can depend on spread coverage.
Confirm zero/negative boundaries on your EA before relying on them.
Given: FX-5 EURUSD, illustrative entry 1.10000; 1 pip = 0.00010. Buy; initial SL 1.09800; distance 8, step 3.
Result: Calculated; trade not executed At +12 pips, the first illustrated trailing request is SL 1.10040.
Why: 12 (trigger) − 8 (distance) = +4 pips from entry; 1.10000 + (4 × 0.00010) = 1.10040.
Positive whole-number walkthrough; requested changes assumed accepted. Update cadence and quote-side sampling are not simulated.
traildist=
Section titled “traildist=”Distance from current price to the trailing stop. Without an initial stop, the reference describes adding one when trailing activates. Loss-based volume still requires its initial explicit stop.
Given: FX-5 EURUSD, illustrative entry 1.10000; 1 pip = 0.00010. Buy; trigger 12, distance 8, step 3.
Result: Illustrative; trade not executed At price 1.10120, the illustrated stop is 1.10040, 8 pips behind price.
See the complete shared trailing sequence; the example assumes accepted stop changes.
trailstep=
Section titled “trailstep=”Further favourable movement needed for each adjustment. With trigger 12, distance 8 and step 3, a buy’s stop is first requested 4 pips above entry, then 7 pips above entry after the next three-pip move.
Units: pips, regardless of the EA’s Target Type. This walkthrough uses whole numbers.
Fractional inputs: rounded, but direction and tie handling are not established here. No fractional result is predicted.
Given: FX-5 EURUSD, illustrative entry 1.10000; 1 pip = 0.00010. Buy; trigger 12, distance 8, step 3.
Result: Calculated; trade not executed At +14 pips, retain 1.10040. At +15 pips, request 1.10070; a pullback to +13 retains it.
Why: Next adjustment = 12 + 3 = 15 pips; stop = 15 − 8 = +7 pips, or 1.10070.
Illustrated no-op states are part of the sequence; they do not establish actual broker sampling or fills.
- Trigger · 12 pips
- Distance · 8 pips
- Step · 3 pips
- Buy entry
- 1.100000 pips
- Price
- 1.100000 pips
- Stop request
- 1.09800−20 pips
This example starts with sl_pips=20. The initial stop stays in place until trailing activates.
Initial stop: 1.10000 − 0.00200 = 1.09800.
Read the six-step example
- Start at entry
Price: 0 pips (1.10000). Stop request: −20 pips (1.09800). 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 rises, but not far enough
Price: +8 pips (1.10080). Stop request: −20 pips (1.09800). The move is still below the trigger. The initial stop is unchanged. +8 is below the +12-pip trigger.
- Trigger reached
Price: +12 pips (1.10120). Stop request: +4 pips (1.10040). Request the first trailing adjustment: move the stop to 8 pips behind this price. 12 − 8 = +4 pips above entry.
- Wait for the next step
Price: +14 pips (1.10140). Stop request: +4 pips (1.10040). Price 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.
- Move the stop up
Price: +15 pips (1.10150). Stop request: +7 pips (1.10070). Price has gained another 3 pips since the last adjustment. Request a higher stop. 15 − 8 = +7 pips above entry.
- Price pulls back; the stop stays
Price: +13 pips (1.10130). Stop request: +7 pips (1.10070). The 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.
atrtimeframe=
Section titled “atrtimeframe=”Choose the ATR timeframe in minutes. Include atrperiod= too.
- Data: the broker’s MetaTrader series; it may differ from TradingView.
- Updates: each bar close of the selected timeframe.
The MT4 timeframe choices listed here are 1, 5, 15, 30, 60, 240 and 1440 minutes. Look up the broker data and EA configuration. Confirm other MT5 choices on your installed EA rather than assuming every numeric value works.
Given: Broker MetaTrader data; hourly bars; 14 periods.
Result: Calculated; trade not executed Requests ATR trailing using 14 periods on the 60-minute timeframe; calculations update at its bar closes.
Why: 60 minutes = one hour per bar; 14 periods selects 14 hourly bars, not 14 minutes.
The actual ATR value and stop require broker data and the specified bar selection; no live ATR is supplied here.
atrperiod=
Section titled “atrperiod=”The number of periods used for Average True Range, such as 14. Along with atrtimeframe=, this is required for ATR trailing.
Given: Broker MetaTrader data; 60-minute bars; intentional lookback variation.
Result: Illustrative; trade not executed Requests a 20-period hourly ATR lookback; the actual ATR value is not supplied.
Changing the lookback does not by itself determine the ATR distance. Use broker data for the same symbol and timeframe.
ATR: convert the distance before placing the stop
Section titled “ATR: convert the distance before placing the stop”Given ATR in price units:
| Direction | Illustrated candidate stop |
|---|---|
| Buy | Current price − ATR × multiplier |
| Sell | Current price + ATR × multiplier |
The model retains an already tighter stop. If ATR is in pips, convert it with the PineConnector pip size.
Actual ATR needs the broker series and bar selection. The samples below are not an indicator calculation.
atrmultiplier=
Section titled “atrmultiplier=”Multiplier applied to the ATR distance. Default: 1. A value of 2 uses twice the calculated ATR.
Given: Illustrative hourly bar: price +18 pips; supplied ATR 7 pips; buy; initial SL −20; trigger 8 reached.
Result: Calculated; trade not executed Calculated candidate SL +4 pips from entry, or 1.10040, if it tightens the existing stop.
Why: 7 (supplied ATR pips) × 2 (message multiplier) = 14 pips; +18 − 14 = +4 pips.
ATR is supplied sample data, not an indicator computed by the widget. Broker acceptance and exact ATR bar conventions remain separate.
atrshift=
Section titled “atrshift=”The bar offset used for ATR calculation. Default: 0. Confirm the exact closed-bar convention on your version when matching another indicator’s output.
Given: Broker ATR; 60-minute timeframe; 14 periods.
Result: Illustrative; trade not executed Requests ATR bar offset 1. This page does not establish the exact closed-bar mapping for your EA build.
An exact ATR value cannot be derived without the build-specific bar selection and broker series.
atrtrigger=
Section titled “atrtrigger=”Set the favourable pip movement before ATR trailing begins. Default: 0, described as immediate activation subject to initial-stop placement.
Without an initial stop, the ATR reference describes adding one from its calculation. Loss-based sizing still requires an explicit initial stop.
Check the initial stop, activation and later adjustments. Test the interaction before combining stop-management features.
Given: FX-5 EURUSD, illustrative entry 1.10000; 1 pip = 0.00010. Buy; initial SL 1.09800; ATR timeframe 60, period 14.
Result: Calculated; trade not executed Requests ATR activation after an 8-pip favourable move, at illustrative price 1.10080. The next stop needs the ATR value.
Why: 1.10000 + (8 × 0.00010) = 1.10080.
Activation and later bar-close adjustments are separate. No stop level is inferred without ATR data.
Step through the bars and adjust the multiplier. Higher ATR can widen the calculated distance while an existing stop stays in place.
Example hourly bar closes · shaded bars have higher sample ATR
- Sample ATR
- 22 pips At bar 6
- ATR × multiplier
- 44 pips 22 × 2.0
- Stop from entry
- +8 pips Previous level retained
At bar 6, +43 − 44 = −1 pips would loosen the stop. Keep the previous +8-pip level.
Illustrative ATR samples, not a calculated indicator or live candles. Buy example: initial SL −20 pips, atrtrigger=8. Each multiplier redraws a separate scenario. Real ATR uses broker MetaTrader data and may differ from TradingView.
Calculated example; not an executed trade.
Read the example
Given: FX-5 buy at 1.10000; hourly bar closes, supplied ATR samples in pips; initial stop 20 pips.
Alert: LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,atrtimeframe=60,atrperiod=14,atrmultiplier=2,atrtrigger=8
Result and why: This example uses hourly bar closes and illustrative ATR samples. At bar 3, price is 18 pips above entry and ATR is 7 pips. With atrmultiplier=2, the distance is 14 pips and the illustrated stop request is +4 pips.
At bar 5, price is +37 and ATR is 17: the 34-pip distance would give +3. The illustrated stop has already reached +8 at bar 4, so it stays at +8 instead of loosening.
ATR updates occur at bar closes of atrtimeframe=. atrperiod= determines the averaging lookback; atrmultiplier= scales the distance, atrshift= selects the ATR bar and atrtrigger= controls activation. This drawing uses supplied sample ATR values and does not simulate all of those inputs.
Filters and identifiers
Section titled “Filters and identifiers”spread=
Section titled “spread=”Set the maximum entry spread in PineConnector pips. 2 means two pips; decimal values are supported.
Spread = (Ask − Bid) ÷ pip size at arrival. Less than or equal to the limit passes this filter only.
Given: FX-5; bid 1.10000 and ask 1.10020 at arrival.
Result: Calculated; trade not executed Spread is 2 pips, so it passes spread=2 only. Other filters and broker checks remain.
Why: (1.10020 − 1.10000) ÷ 0.00010 (fixture pip) = 2 pips; 2 ≤ 2.
Use the broker quote at arrival. Passing this filter is not a confirmed order or a later retry.
Adjust the maximum spread. Inspect a marker to see which of these ten example alerts passes this one filter.
Each marker is one incoming alert
- Example alerts
- 10 One check at each arrival
- Pass this filter
- 8 Other checks still apply
- Filtered out
- 2 Above this spread limit
Alert 4: 3.8 > 2.0 pips — filtered out at that arrival.
Each marker uses the spread at that alert’s arrival. Passing this filter does not confirm an order: other EA checks and broker rules still apply.
Calculated example; not an executed trade.
Read the example
Given: Ten supplied arrival observations in PineConnector pips; spread limit 2; FX-5 entry example.
Alert: LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,spread=2
Result and why: With spread=2, a spread of 1.2 pips passes and a spread of exactly 2 pips also passes. A spread of 3.8 pips fails this filter.
Eight of these ten illustrative alerts pass the 2-pip limit. A later narrowing is a different observation; it does not change the spread recorded for an earlier alert. Review the signal’s processing result before deciding what to do next.
accfilter=
Section titled “accfilter=”A threshold using the EA’s Account Filter Type: balance, equity, free margin or margin percentage. 500 is not enough information on its own to identify the metric.
Look up the actual metric and setting. This page does not establish the comparison for every Account Filter Type, including whether equality passes. Do not infer pass/fail from 500 alone.
Given: Threshold 500; Account Filter Type and its comparison not supplied.
Result: Illustrative; trade not executed Passes threshold 500 to the selected account metric. Pass/fail cannot be determined from this message alone.
Why: The EA setting chooses the metric. Its comparison rule and current value are additional inputs; the message alone cannot supply a pass/fail result.
Read the receiving EA setting, current metric and setting-specific comparison; equality is unresolved here.
comment=
Section titled “comment=”Use a short strategy identifier:
- Up to 20 characters.
- Spaces are shown in the reference.
- Avoid commas: they separate message fields.
Short plain identifiers avoid disputed special-character and overlength behaviour in older guides.
For strategy separation, check scope and use the exact matching comment and supported commands in Multi-Strategy.
Given: Strategy identifier, 10 characters including the space.
Result: Illustrative; trade not executed Requests the position label Strategy A. A supported comment-filtered exit uses that exact label.
Why: The string supplies the label; exact matching and supported command scope determine any strategy-specific selection.
Up to 20 characters; no comma. Scope and command support still matter; a label is not isolation from all other commands.
secret=
Section titled “secret=”Add your case-sensitive Signal Authentication key when authentication is enabled. A missing or different value prevents forwarding to the terminal.
A saved License ID does not add or verify the key. Configure authentication.
Never use a broker password or share the real secret in a copied page or support screenshot.
Given: Authentication enabled for the intended License ID.
Result: Illustrative; trade not executed Forwards only when the supplied key matches the saved case-sensitive key; this placeholder is not a working secret.
Why: Authentication compares the supplied value with the saved key, including its letter case; the placeholder supplies no real credential.
Replace YOUR_SECRET_KEY privately. Never paste a real key into documentation, exported examples or support screenshots.
EA controls
Section titled “EA controls”| Command | Required third field | Request |
|---|---|---|
eaoff |
eaoff |
Halt processing of incoming signals. |
eaon |
eaon |
Resume a halted EA. |
closealleaoff |
Receiving EA’s chart symbol | Close positions/cancel pending orders within scope, then halt. |
closeall uses that chart-symbol requirement too. Identify the receiving EA’s actual chart; do not guess a symbol for an account-wide action.
| Example | Alert message |
|---|---|
| 1Halt EA | Result: Illustrative; trade not executed Requests a halt to incoming signal processing; this command does not request position closure. |
| 2Resume EA | Result: Illustrative; trade not executed Requests resumption of a halted EA; this command does not request a new entry. |
| 3Close and halt | Result: Illustrative; trade not executed Replace ChartSymbol with the receiving EA chart symbol. Requests closure/cancellation within scope, then a halt; inspect each result. |
See the shared scope and chart-symbol rule before using an EA-wide command.
Check the result
Section titled “Check the result”Receipt is the first check. Broker outcome is a separate check. On demo, verify the intended account, symbol, direction, volume, entry, stop and target.
Check both halves of a cancel-and-replace request
Section titled “Check both halves of a cancel-and-replace request”- Find the delivery record. It establishes receipt, not whether cancellation or replacement succeeded.
- Inspect old pending orders. Record what remains. Checking only the new order leaves cancellation unverified.
- Inspect the new order. Compare requested entry, volume and targets with the broker result.
Why: one message can request two actions; one observed result does not prove both completed.
Illustrative request; not an executed trade. No actual outcome or automatic retry is assumed.
For any close or modification, check what changed and what remained. Inspect existing orders before retrying.
Follow the complete test workflow · Build or check a message · Troubleshoot an error.
Maintaining an older alert? The archived parameter reference preserves its setting-dependent interpretation.






