Guide / Checked Nov 2026
How do I automate trades from a TradingView indicator?
An indicator() script has no strategy placeholders, so you create one TradingView alert per side and set Trigger to Once per bar close. Each message spells out its own action and direction, such as {"action": "OPEN", "instrument": "{{ticker}}", "direction": "LONG"}. Paste your Nyria strategy's webhook URL into each alert's Notifications and a bot places the order. To keep one alert instead, convert the indicator to a strategy() so a single Order fills only alert covers all sides.
Official documentation
Automate an indicator in six steps
- 1
Create the strategy in Nyria
Select Create strategy, pick TradingView and set Script type to Indicator on the Integration tab. Nyria lists each alert you need, with its message and URL.
- 2
Open the alert on your indicator
Select Alert on the top toolbar, or press Alt + A. Set Condition to your indicator and pick the alert condition for this side.
- 3
Set Once per bar close
Once per bar can fire twice in one bar and send conflicting orders. Once only stops after the first alert.
- 4
Paste the message for this side
Each message spells out its own action, OPEN or CLOSE, and direction, LONG or SHORT. {{ticker}} and {{close}} fill in when it fires.
- 5
Add the webhook URL
Open Notifications, tick Webhook URL, paste the strategy's URL and select Apply. TradingView remembers the last URL, so replace any already there.
- 6
Repeat per side, then check
Create one alert for each side you trade, then select Check format in Nyria. Deploy a bot on Nyria Paper first.
Messages to copy
Long entry
{
"action": "OPEN",
"instrument": "{{ticker}}",
"direction": "LONG",
"price": {{close}}
}Long exit
{
"action": "CLOSE",
"instrument": "{{ticker}}",
"direction": "LONG",
"price": {{close}}
}Indicator or strategy
- An indicator traded on 4 sides across 5 tickers needs 20 alerts. As a strategy, 5.
- Indicators have no strategy.* placeholders, so each message spells out its own action and direction.
- Converting swaps indicator() for strategy() and turns each arrow into strategy.entry or strategy.close. The math stays.
- A strategy also backtests in the Strategy Tester.
What the indicator alert can carry
- {{ticker}}, {{close}}, {{interval}}, {{time}}, {{timenow}} and {{exchange}}.
- {{plot_0}} to {{plot_19}}, the numbered plot values from the script.
- A Pine name such as {{syminfo.ticker}} isn't a placeholder. TradingView sends it as typed.
- Size never comes from the alert. Budget per entry decides.
Questions
- Does strategy.order.action work in an indicator alert?
- No. The strategy placeholders exist only in a strategy() script. Write OPEN or CLOSE and the direction into the message instead.
- Do I need a separate alert for each ticker?
- Yes. An indicator needs one alert per condition per ticker. Converting to a strategy cuts it to one Order fills only alert per ticker.
- Why Once per bar close and not Once per bar?
- Once per bar can fire twice inside one bar and send conflicting orders. Once per bar close fires once, on the confirmed close.
- Do I need a paid TradingView plan?
- Yes. TradingView sends webhooks on paid plans only, with two-factor sign-in on. Nyria Paper is free.
- What does it cost?
- Paper is free. Live trading from $15 a month.
Next
- Paste an alert into the alert tester to see how Nyria reads it.
- Write a TradingView message with the alert builder.
- Step by step for one account: how to automate TradingView to Nyria Paper.
- Step by step for one account: how to automate TradingView to Alpaca.
- TradingView alert message builder.
Guides
Can TradingView auto trade without code?
A chart alert, a pasted webhook URL and a plain-text message: orders at your broker with no code.
TradingView alert placeholders
Every {{ticker}} and {{strategy.*}} placeholder, what it becomes when the alert fires.
How do I auto execute trades from a TradingView strategy?
An alert on the strategy, Order fills only, and the strategy placeholders in the message.
Why does my TradingView alert place duplicate orders?
TradingView fired twice. Nyria drops a repeat body, and skips a second entry when multiple entries are off.
How do I close or reverse a position with a TradingView alert?
CLOSE with the direction exits. One alert that reports the flip reverses.
Try a paper bot first
No card required. Paper is free. Live trading from $15 a month.