Skip to content

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. 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. 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. 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. 4

    Add the webhook URL

    Open Notifications, tick Webhook URL, paste the strategy's URL and select Apply, then select Create.

  5. 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. 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

Auto trade a TradingView strategy, no code (2026)
A TradingView strategy on Order fills only becomes bot orders, no code needed.
Steps in the video
  1. 0:00Create the strategy in Nyria. Select Create strategy, pick TradingView as the source, choose stocks and a ticker, then create the draft.
  2. 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.
  3. 2:27Check the format. Select Check format and add a sample entry and exit. Nyria shows the ticker, side and order it read.
  4. 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.
  5. 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

Try a paper bot first

No card required. Paper is free. Live trading from $15 a month.