Connect a Pine Script to PineConnector
Choose how to add PineConnector alert messages to a TradingView indicator or strategy, then verify the result on demo.
To connect your script to PineConnector, identify the event that should send an alert, give it the correct PineConnector message, and configure the TradingView webhook. The script stays in TradingView; the PineConnector EA handles the received request in MetaTrader.
Choose the path for your script
Section titled “Choose the path for your script”| What you have | Start here |
|---|---|
| An indicator or strategy with editable source | Add alerts to your script explains how to identify the signal conditions and add messages. |
| A script with alert options but no editable source | Connect your strategy shows the available no-code paths. What you can send depends on the script’s alert controls. |
| An older script that needs a language upgrade | Convert Pine Script versions, then return to the appropriate alert guide. |
| No script yet; you want to understand an example | Browse the strategy walkthroughs and their prerequisites. |
If a protected script does not expose a suitable alert message, ask its author to add PineConnector-compatible alerts. The author can use the low-code guide to add the required inputs and messages without giving you the script’s source. Do not treat access to the chart as permission to edit or recover protected code.
Decide what should trigger the message
Section titled “Decide what should trigger the message”For an indicator, identify the actual buy, sell and exit conditions. A plotted arrow or a variable called buy is not enough to establish when an order should be requested.
For a strategy, distinguish a signal calculation from a simulated order fill. TradingView’s order-fill events belong to its broker emulator; they are not confirmations of an MT5 broker fill. Follow one alert path from the relevant guide rather than enabling multiple event sources for the same intended request. TradingView’s alert reference explains the available event types.
Before changing code, write down:
- When to enter and exit, including whether the signal waits for the bar to close.
- What an opposite signal should do to an existing position.
- The exact receiving broker symbol and intended sizing method.
- Which existing alerts the new setup will replace.
Add messages and verify the result
Section titled “Add messages and verify the result”Follow the guide selected above with the PineConnector Syntax reference beside it. If you edit source code, preserve the script’s intended conditions and review existing alert calls before adding another source of messages.
Use the demo test procedure to check your connection first. Then observe a new real-time event from your adapted script and follow that event through TradingView’s alert log, PineConnector’s receipt and the broker outcome. Confirm the intended account, symbol, direction and volume, and check for duplicates. A temporary connection test, compilation or chart marker alone does not verify the adapted script.
If you cannot determine the script’s entry or exit rules, ask its author before adapting it. If the alert fires but the expected order is missing, follow Missing signals.
