NRUNO · TradingView + cTrader
alert(), alertcondition() or strategy order fills?
Use alertcondition() for a selectable indicator condition, alert() for a message built in code, and order-fill alerts for a strategy emulator's fills. The choice determines what your webhook sends and when.
Reviewed 15 September 2026 · NRUNO
Choose by the event you actually need
| Mechanism | Where it is used | Message source | Trigger |
|---|---|---|---|
alertcondition() | Indicators | Constant message with supported placeholders; configurable in the alert dialog. | A selected indicator condition. |
alert() | Indicators or strategies | A string built in Pine code, including dynamic values. | Execution reaches the call and its frequency allows it. |
| Strategy order fill | Strategies | Alert dialog text; custom order messages through alert_message. | The TradingView broker emulator fills a strategy order. |
None of these automatically confirms a fill in your real cTrader account. The webhook receiver, cBot and broker process that instruction separately.
Indicator with separate buy and sell conditions
If an indicator exposes Buy and Sell through alertcondition(), create a separate alert for each condition. Use the corresponding NRUNO buy or sell message. Your chosen frequency must match the indicator's intended behaviour, such as waiting for a bar to close.
An indicator may draw signals without exposing alert conditions. A message pasted into TradingView does not turn those drawings into an alert. Check what the indicator author actually supports.
Dynamic messages from alert()
Use alert() when the code must build a message using values available at runtime. In the alert dialog, select the script's alert() calls. The code supplies the message, so a strategy order-message placeholder is not the source of an alert() message.
Frequency and script execution both matter. A strategy that calculates only on bar close will not suddenly produce intrabar messages because an alert frequency setting sounds immediate. Review the strategy calculation settings separately.
Strategy order fills and alert_message
For the NRUNO wrapper below, each relevant order call must supply a valid JSON object as its alert message:
{"tvAlertTime":"{{timenow}}","payload":{{strategy.order.alert_message}}}
Here is a message fragment to adapt inside an existing strategy. It is not a complete strategy or an entry recommendation:
entryMessage = '{"symbol":"EURUSD","signal":"LONG","sizing":"LOCAL"}'
strategy.entry("Long", strategy.long, alert_message=entryMessage)
In this example EURUSD must match your cTrader setup. sizing: LOCAL selects the cBot's configured sizing. The outer wrapper supplies the alert timestamp.
Give the exits that should notify NRUNO their own supported message through strategy.exit() or strategy.close(). See the exit message format. An order call without alert_message can produce an empty replacement string.
Do not accidentally send the same entry twice
A strategy can use alert() calls and order-fill alerts. Selecting both can produce two notifications for a single trading idea if the script emits both. Choose the mechanism intended by the script author and confirm how many instructions appear in the alert log.
Also check for older active alerts on the same script. Renaming or changing the chart does not stop an existing server-side alert.
Recreate the alert after changing the script
TradingView stores a copy of the script, inputs and chart context when it creates a script alert. Saving new code on your chart does not update that running copy. Stop the obsolete alert and create a new one with the intended settings.
Then check one intended entry and exit on demo. The webhook troubleshooting guide helps if the new alert triggers but execution is missing.
Try the connection with your own setup
14 days free, no payment card and no automatic paid subscription. Ask us if you need help choosing the right alert.
Technical sources
TradingView: webhook alerts · Pine Script: alerts · Pine Script: alert FAQ