Skip to content
Docs
Open Portal
Copy manually

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

Connect your strategy

Answer a few questions to find the right alert setup, or prepare your Pine Script with the guided converter.

Find the right alert setup for your script.

Have the source code? Convert your Pine Script. New to PineConnector? Test your demo setup first.

Before creating strategy alerts: connect the intended account through Getting started, then complete the demo test. Check every account sharing the License ID, the exact case-sensitive broker symbol, and the broker’s permitted lot size and session. Add your configured secret= privately if Signal Authentication is enabled; a saved License ID does not add it.

Explicit units specify size and targets, not which positions can be affected. Confirm Magic Restriction, Pyramiding for repeated entries, and Close on Reverse against your intended entries and exits. On self-hosting, check your receiving EA’s inputs. On Edge, open Edge → instance → EA Settings and follow the hosted settings procedure to review and confirm changes. Applying changes restarts the terminal and interrupts signal execution. If those settings do not establish that your workflow is supported, ask Support before creating alerts. Editing a local EA does not change Edge.

Open your recommended guide below.

Find your script’s alert optionsWhere to look in Settings and Create alert, with screenshots.
What you can select or edit Follow this setup
Order fills only in a strategy’s alert options Strategy order-fill alerts
A script’s Inputs include PineConnector messages or a License ID, and its author supports PineConnector A PineConnector-ready script
Named indicator conditions such as Buy, Sell, Going Long or Going Short Choose entry and reversal or buy and close, according to the intended actions.

Open Create alert and select your script under Condition. If Order fills only is available, it can generate events when TradingView’s broker emulator fills the strategy’s simulated orders.

TradingView strategy alert menu with Order fills only selected and the other alert event options visible
Published TradingView example from 2025. An order-fill event comes from the strategy simulation; it is not confirmation of a MetaTrader trade.
Published TradingView example from 2025. An order-fill event comes from the strategy simulation; it is not confirmation of a MetaTrader trade.Open original
TradingView strategy alert menu with Order fills only selected and the other alert event options visible

This makes alerts available; it does not establish that the strategy’s entries, exits and sizing map correctly to PineConnector. Read the limitation in the strategy setup before connecting it.

Open the script’s Settings → Inputs. Look for fields such as License ID, Symbol, Long alert message, or Short alert message. Confirm with the author that they produce PineConnector-compatible messages.

Settings control beside an indicator name on a TradingView chart
The script’s own Settings control opens its inputs. Published example from 2022.
The script’s own Settings control opens its inputs. Published example from 2022.Open original
Settings control beside an indicator name on a TradingView chart

A field called License ID alone is not proof of compatibility. If the author has not exposed usable messages, continue to the next test.

Open Create alert, select the indicator, then open its condition list. Look for separate entry conditions named by its author. Generic comparisons such as Crossing alone are not the same as a dedicated Buy or Sell condition.

See an example of named conditions
An indicator alert dropdown showing Going Long and Going Short above generic Crossing choices
Focused view of the published dropdown example from 2022. Names vary by script. Enlarge to see the full original.
Focused view of the published dropdown example from 2022. Names vary by script. Enlarge to see the full original.Open original
An indicator alert dropdown showing Going Long and Going Short above generic Crossing choices

Ask the script author to add alert support or PineConnector compatibility. The author can use the Pine Script alert instructions without publishing their private strategy logic. A picture of an entry on the chart cannot, by itself, create an alert.

Strategy order-fill alertsCheck how simulated entries and exits map to PineConnector commands.
  1. Select your strategy, symbol and timeframe in Create alert.
  2. Choose Order fills only.
  3. Choose a message that matches the strategy’s intended order handling.
  4. Add the webhook URL, then create the alert.

For a workflow where every fill is intentionally a buy or sell entry request, this example uses the simulated order’s direction and the alert’s ticker. Use the ticker only if it matches the exact symbol on every receiving broker account.

Strategy direction and chart symbolUse only after confirming that all strategy fills should become entry requests.
TradingView → Message PineConnector Syntax
LicenseID,{{strategy.order.action}},{{ticker}},vol_lots=0.01

Expected request: a buy or sell of 0.01 lots on the resolved symbol for each eligible fill. No SL or TP is specified in this message. Illustrative request; not an executed trade. Inspect the final alert text and actual broker positions, including exits and duplicates, using the checks below.

If the script’s own instructions use {{strategy.order.alert_message}}, follow those instructions instead. That placeholder reads messages explicitly supplied by the script author.

Can I use the strategy’s quantity as risk?

The old guide shows risk={{strategy.order.contracts}}. That quantity belongs to TradingView’s simulated order. It is not automatically MetaTrader lots, cash risk or a percentage. Only map it after checking units, instrument contract sizes, reversal quantities and the EA’s Volume Type.

Quantity mapping to reviewReference template only. The quantity conversion must match your setup.
TradingView → Message PineConnector Syntax
LicenseID,{{strategy.order.action}},{{ticker}},risk={{strategy.order.contracts}}
A PineConnector-ready scriptUse the message inputs and alert method supported by the script’s author.
  1. Open the script’s Settings → Inputs.
  2. Enter your License ID, broker symbol and any message/risk/stop settings provided by its author. Save the inputs.
  3. Create an alert for the desired symbol and timeframe.
  4. Select the alert event type specified by the author. Scripts using alert() need Any alert() function call or alert() function calls only. Strategies supplying alert_message on orders need Order fills only and {{strategy.order.alert_message}} in Message.
  5. Add the webhook below and create the alert.

The script builds the message in this method. Do not add a second message template or enable additional event types unless the author’s instructions require it. Inspect the first triggered message to check the values it actually sends.

Buy and Sell should reverse the positionBuy closes shorts and opens a long. Sell closes longs and opens a short.

Use this path when each new direction should replace the opposite position. The Buy and Sell conditions need two TradingView alerts, each with its own message.

Before testing: use a dedicated symbol and EA scope on every account sharing this License ID. Check Pyramiding to prevent repeated entries from adding positions. On Edge, use the available hosted controls and Support checks above to confirm the receiving configuration.

Replace LicenseID, BrokerSymbol and LotSize in these templates. Use the exact broker symbol and a suitable demo lot size; no stop loss or take profit is included. Add your secret= privately if Signal Authentication is enabled.

  1. Open Create alert, select your indicator and its Buy condition, and choose Once Per Bar Close. Enter the completed Buy template in Message.
Buy condition: close shorts, then request a buyStructure template. Replace LicenseID, BrokerSymbol and LotSize before use.
TradingView → Message PineConnector Syntax
LicenseID,closeshortopenlong,BrokerSymbol,vol_lots=LotSize
  1. Create a second alert for the same indicator, symbol and timeframe. Select its Sell condition, choose Once Per Bar Close, and enter the completed Sell template.
Sell condition: close buys, then request a sellStructure template. Use the same intended destination and your chosen fixed lot size.
TradingView → Message PineConnector Syntax
LicenseID,closelongopenshort,BrokerSymbol,vol_lots=LotSize
  1. Add the webhook URL to both alerts. Remove superseded alerts that could duplicate them.
  2. Observe an entry from flat, then each reversal direction on demo. Verify the old opposite position closed and the expected new position opened at the requested size, on every intended receiving account.

Check both actions. A combined close-and-open command does not guarantee that both actions complete. Pause the alerts if the result differs, or if Buy and Sell can trigger together; resolve that behaviour before continuing.

Buy should open a long; Sell should close itA long-only setup, with no short entry requested by the Sell signal.

Use this path when Buy opens a long position and Sell means exit that long. The Sell alert uses closelong; it does not request a new short.

Before testing: closelong affects matching buys in the EA scope on every account sharing this License ID. Use a dedicated symbol and scope; check Pyramiding to prevent repeated Buy signals from adding positions. On Edge, use the available hosted controls and Support checks above to confirm the receiving configuration.

Replace LicenseID, BrokerSymbol and LotSize in these templates. Use the exact broker symbol and a suitable demo lot size; no stop loss or take profit is included. Add your secret= privately if Signal Authentication is enabled.

  1. Open Create alert, select your indicator and its Buy condition, and choose Once Per Bar Close. Enter the completed Buy template in Message.
Buy condition: request a fixed-lot buyStructure template. Replace LicenseID, BrokerSymbol and LotSize before use.
TradingView → Message PineConnector Syntax
LicenseID,buy,BrokerSymbol,vol_lots=LotSize
  1. Create a second alert for the same indicator, symbol and timeframe. Select its Sell condition, choose Once Per Bar Close, and enter the completed close template.
Sell condition: close matching buysStructure template. Replace LicenseID and BrokerSymbol with the same destination as the Buy alert.
TradingView → Message PineConnector Syntax
LicenseID,closelong,BrokerSymbol
  1. Add the webhook URL to both alerts. Remove superseded alerts that could duplicate them.
  2. Observe a Buy and then a Sell condition on demo. Verify that the expected buy opens, then closes, and that no short position opens on any intended receiving account.

If Buy and Sell can occur together, or the broker result differs, pause both alerts and resolve the cause before continuing. For short-only or independent entry/exit setups, use the exact close-position commands or the Pine Script converter when you have the source.

I’m unsure what Buy and Sell should doEstablish entry, exit and reversal intent before choosing a message.

Check the script author’s instructions for both conditions:

Intended behaviour Follow this path
Buy closes shorts and opens a long; Sell closes longs and opens a short. Entry and reversal
Buy opens a long; Sell closes that long without opening a short. Buy and close
Buy and Sell are independent entry requests, with exits managed separately. Independent entry conditions
The meaning is undocumented or differs from these cases. Ask the author which conditions mean entries, full exits, partial exits or reversals. Use the command reference once those actions are established.

A condition name or chart arrow cannot establish the intended order action. Do not connect it until that meaning is clear.

Buy and Sell are independent entry requestsReference for scripts whose exits are handled separately; a sell entry is not a close-long command.

Use this reference only when Buy and Sell are independent entries and you have a separate, deliberate exit method. For the common alternatives, use entry and reversal or buy and close.

Create two alerts for the same symbol and timeframe: one for the Buy/Long condition, another for the Sell/Short condition.

  1. Select the indicator and its Buy or Going Long condition.
  2. Set the trigger to Once Per Bar Close for this guide’s example.
  3. Paste the buy message below, with your exact broker symbol and a permitted demo vol_lots= value.
  4. Add the webhook and create the alert.
  5. Repeat using the Sell or Going Short condition and the sell message.

These examples use EURUSD. Replace it if your broker uses a different name or suffix. The fixed-lot messages specify no stop loss or take profit; check the receiving settings for omitted targets.

Buy condition
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01
Sell condition
TradingView → Message PineConnector Syntax
LicenseID,sell,EURUSD,vol_lots=0.01

Expected request: each eligible Buy condition requests a 0.01-lot buy; each eligible Sell condition requests a 0.01-lot sell. Illustrative request; not an executed trade. Check the final text and actual broker result below, including any reversal or duplicate.

To specify targets as well, use explicit pip distances:

Buy condition with pip targets
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,vol_lots=0.01,sl_pips=20,tp_pips=40

Calculated request: given an illustrative EURUSD entry of 1.10000 and quoting Point 0.00001, one PineConnector pip is 0.00010. The 20-pip stop is 1.10000 − 20 × 0.00010 = 1.09800; the 40-pip target is 1.10000 + 40 × 0.00010 = 1.10400, with 0.01 lots requested. Calculated example; not an executed trade. Use your broker’s actual entry and pip size; permitted stop distances, price increments and volume rules still apply.

Maintaining older risk / sl / tp messages

The older entry forms below are retained for existing setups. risk=1 requests one lot only with Volume Type = Lots and a Setting mode that takes Risk from the signal. It does not mean 1% risk.

Legacy fixed-lot buyMaintenance example: one lot only under the stated receiving settings.
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,risk=1
Legacy fixed-lot sellMaintenance example: one lot only under the stated receiving settings.
TradingView → Message PineConnector Syntax
LicenseID,sell,EURUSD,risk=1

The legacy pip-target form additionally assumes Target Type = Pips and Setting = Signal Parameters Only: it requests one lot, a 10-pip stop and a 20-pip target. Those are different illustrative values from the new 0.01-lot, 20/40-pip example above, not an equivalent numerical conversion.

Legacy buy with pip targetsMaintenance example: confirm all stated settings and choose permitted demo values.
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,risk=1,sl=10,tp=20

Illustrative request; not an executed trade. For an exact old/new comparison, see the legacy input comparison. Keep existing behaviour only after checking compatibility and the actual demo result.

Use {{ticker}} in place of EURUSD only when TradingView’s ticker matches your broker’s symbol. These indicator conditions do not provide strategy order placeholders such as {{strategy.order.action}}.

Placeholder Meaning Use in
{{ticker}} The alert’s ticker Supported TradingView alert message fields
{{strategy.order.action}} The simulated fill’s buy/sell direction Strategy order-fill alerts
{{strategy.order.contracts}} The simulated order’s quantity Strategy order-fill alerts; conversion needs review
{{strategy.position_size}} The strategy’s signed position size Strategy alerts, not broker account state
{{strategy.market_position_size}} The strategy’s absolute position size Strategy alerts, not broker account state

See TradingView’s alert reference for how each alert method works. Placeholders in the alert dialog are different from Pine Script expressions used inside alert(...).

Enable Webhook URL in the alert’s notification settings and paste:

TradingView requires two-factor authentication for webhooks. If the webhook option is unavailable, check your TradingView account settings and feature access.

Wait for a real-time condition on your demo setup, then compare:

Check What to confirm
TradingView Alerts log Direction, License ID, final symbol and parameter values are correct. No unresolved placeholders remain.
PineConnector Signals log The same message arrived and its processing result is visible.
MetaTrader The intended account has the expected direction, volume and stops, with no duplicate or unintended reverse trade.

On Edge: select the affected instance in Portal → Edge → Experts / Journal using the hosted log walkthrough, then verify positions or history on the same broker account through its supported MT5 app or terminal. On self-hosting: use your receiving terminal’s logs and positions. A website or Copy check is not a trade test.

A received alert is not proof of a broker fill. Use Missing signals to find where the path stopped, or Errors when a processing error is shown.

If the message or resulting trade is wrong, pause the alert in TradingView’s Alerts panel before changing and testing it again. For these single-chart methods, create a separate alert for each symbol and timeframe you want to automate, and verify each destination.

Ready to continue: you have checked the strategy’s intended entries and exits on demo, including the account, symbol, trade size and any stops. Remove test alerts that could duplicate your strategy’s requests.

The Logistic Regression walkthrough uses named Buy and Sell conditions. The SuperTrend walkthrough uses messages generated by Pine Script.