Skip to content
Docs
Open Portal
Copy the page manually

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

Connect your strategy

Use your script’s existing alerts to connect its trading instructions to your verified demo setup.

With your demo setup verified, connect your own indicator or strategy. This default path uses alerts the script already provides; you do not need to edit its source.

Add the script to your chosen TradingView chart before checking its alert options. Open Create alert with Alt+A on Windows or Option+A on Mac.

If you need to change the script’s code, take the optional Low-code guide instead. If you arrived here first, complete Test your setup before creating strategy alerts.

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 Separate buy and sell conditions

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 Enlarge
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 Enlarge
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 Enlarge
Published dropdown example from 2022. Names vary by script.
Published dropdown example from 2022. Names vary by script.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.

  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 template uses the simulated order’s direction and the alert’s ticker. The risk=1 value still follows the EA’s Volume Type.

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}},risk=1

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}}
  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 script and the option for Any alert() function call or alert() function calls only, as available.
  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.

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 chosen risk= 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. risk=1 follows your EA’s Volume Type; add any stop-loss parameters your sizing method requires.

Buy condition
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,risk=1
Sell condition
TradingView → Message PineConnector Syntax
LicenseID,sell,EURUSD,risk=1

For a message that also sets stop loss and take profit, the source guide provides this form. It assumes Target Type = Pips, Volume Type = Lots, and Setting = Signal Parameters Only. Replace the lot size and target distances before testing.

Buy condition with pip targets
TradingView → Message PineConnector Syntax
LicenseID,buy,EURUSD,risk=1,sl=10,tp=20

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.

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.