Guide
How do I auto execute trades from a TradingView strategy?
Nyria auto executes trades from a TradingView strategy in your Charles Schwab, Alpaca, tastytrade or Tradier account. Create the alert on your strategy() script with the condition set to Order fills only. Paste the strategy's Nyria webhook URL into Notifications and put {{strategy.order.action}}, {{ticker}} and the two position placeholders in the message. Every fill then reaches Nyria, and a bot places the order. TradingView sends webhooks on paid plans only. Test on Nyria Paper first.
Official documentation
Auto execute a strategy in six steps
- 1
Create the strategy in Nyria
Select Create strategy and pick TradingView as the alert source. Open the Integration tab and copy the webhook URL and the message.
- 2
Open the alert on your strategy
On the chart, press Alt+A and set the Condition to your strategy() script. Choose Order fills only, so one alert covers every fill.
- 3
Paste the message
Paste the message from the Integration tab. It carries {{strategy.order.action}}, {{ticker}}, {{strategy.market_position}} and {{strategy.prev_market_position}}. TradingView fills them in at each fill.
- 4
Add the webhook URL
Open Notifications, tick Webhook URL, paste the strategy's URL and select Apply, then select Create.
- 5
Check the format
Back in Nyria, select Check format. Nyria reads the two position fields and works out the action and direction from the change.
- 6
Deploy on paper first
Select Deploy bot, choose Nyria Paper and set a Budget per entry. Let the strategy fire for a week, then read the Logs tab against the chart.
Watch the setup

Steps in the video
- 0:00Create the strategy in Nyria. Select Create strategy, pick TradingView as the source, choose stocks and a ticker, then create the draft.
- 0:58The alert in TradingView. Open the alert dialog, set the condition to the strategy, and set Order fills only so each fill sends one message.
- 2:27Check the format. Select Check format and add a sample entry and exit. Nyria shows the ticker, side and order it read.
- 2:50Deploy a bot on paper. Deploy a bot on free Nyria Paper, set a budget per entry, and send a sample alert to watch the fill.
- 3:27What to watch. Watch the bot's Logs tab for the fill, then move to a live broker once the orders match.
Messages to copy
JSON message
{
"ticker": "{{ticker}}",
"action": "{{strategy.order.action}}",
"marketPosition": "{{strategy.market_position}}",
"prevMarketPosition": "{{strategy.prev_market_position}}",
"price": {{close}}
}Plain text message
{{strategy.order.action}} {{ticker}} @ {{close}}What the placeholders carry
- {{strategy.order.action}} is buy or sell.
- {{strategy.market_position}} is long, flat or short after the fill.
- {{strategy.prev_market_position}} is the position before the fill.
- Send both position fields and Nyria reads an entry, an exit or a reversal.
- {{strategy.order.contracts}} is reference only. Each bot sizes from its own Budget per entry.
Strategy or indicator
- The strategy placeholders exist only in a strategy() script.
- An indicator() has none, so it needs one message per side.
- Nyria places market and limit orders. A position closes when an exit alert arrives.
Questions
- Does an indicator work, or only a strategy?
- Both work. A strategy() script sends one Order fills only alert with the strategy placeholders. An indicator() needs one message per side.
- Why did my alert send the placeholder as text?
- An indicator alert has no strategy placeholders, so TradingView sends the braces as typed. Use a strategy() script, or write the side into each message.
- Who sets the order size?
- The bot does. The contracts in the message are reference only, and each bot sizes from its Budget per entry.
- Do I need a paid TradingView plan?
- Yes. TradingView sends webhooks on its paid plans only, with two-factor sign-in turned on. Nyria is free to test on paper.
- 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.
- Nyria for developers.
Guides
How do I automate TradingView alerts to my broker?
The alert, the webhook URL, the message, a paper test, then live.
Read guideCan you trade directly from TradingView?
The trading panel places orders by hand. Alerts never place orders; the webhook route does.
Read guideTradingView webhook JSON format
TradingView sends the Message box as written. What it adds, and what Nyria needs the message to say.
Read guideTradingView alert placeholders
Every {{ticker}} and {{strategy.*}} placeholder, what it becomes when the alert fires.
Read guideHow do I set a stop loss or take-profit from a TradingView alert?
Put the stop in your strategy. Its fill sends the exit alert.
Read guideTry a paper bot first
No card required. Paper is free. Live trading from $15 a month.