Skip to content

Guide

How to automate TradingView alerts, step by step

TradingView fires the alert. Nyria reads it at a webhook URL and each bot on the strategy places the order in its own brokerage account. This guide goes from the first alert to a live bot.

Paid TradingView planNo message templatePaper test first

What you need

  • A paid TradingView plan with two-factor sign-in on. The free plan can't send webhooks.
  • A Pine strategy or indicator that fires the alerts you want to trade.
  • A Nyria account. Paper trading is free, needs no card and has no time limit.
  • For live orders, an account at Charles Schwab, Tradier, tastytrade or Alpaca. You can start without one on Nyria Paper.

Step by step

  1. 1

    Create the strategy in Nyria

    Go to My strategies and select Create strategy. Name it and pick TradingView as the alert source. Choose the asset type and what an entry and an exit do on each side. Keep it Private, add your tickers and select Create draft.

  2. 2

    Copy the webhook URL and the message

    Open the strategy's Integration tab and choose Strategy or Indicator. The Create the alert step shows the alert message and the webhook URL, each with a copy button.

  3. 3

    Create the alert in TradingView

    Press Alt+A (Option+A on a Mac). Set Condition to your script. For a strategy choose Order fills only. For an indicator pick its alert and set Trigger to Once Per Bar Close. Open Message and paste the message from Nyria over the text there. Open Notifications, select Webhook URL and paste the URL. Select Back, then Create.

  4. 4

    Check the format

    Back in Nyria, select Check format, then Check and save. Nyria reads the message the way it will read a live alert and shows the ticker and side it found. The strategy turns Active when every side passes.

  5. 5

    Test on paper

    On the strategy, select Deploy bot. If the switch at the top says Live, select Paper. Set the Budget per entry, select Next, then Deploy on Nyria Paper. Let the alert fire for a few sessions. Each order shows on the bot's Logs tab, so you can hold it up against the alert that caused it.

  6. 6

    Go live

    When the paper orders match what you expect, deploy a bot on your broker account, or edit the paper bot and pick the account. Both bots can run side by side on the same strategy. Start with a small budget per entry.

A repainting indicator fires differently live than it plots on past bars. Check yours before it trades; the TradingView page says what to look for.

The webhook URL

Each strategy has its own. Paste it into the alert's Webhook URL box as it is.

Webhook URL format

https://trades.nyria.io/webhooks/<your-strategy-token>

The token belongs to the strategy, so keep the URL private. If it leaks, select Rotate token on the Integration tab and paste the new URL into the alert.

What the alert message can look like

Nyria reads plain text or JSON in your own wording. Every alert needs a ticker, a direction and an action.

Plain text

SPY long entry

JSON with TradingView placeholders

{
  "ticker": "{{ticker}}",
  "action": "{{strategy.order.action}}",
  "marketPosition": "{{strategy.market_position}}",
  "prevMarketPosition": "{{strategy.prev_market_position}}"
}

TradingView fills in the placeholders before it sends the alert. The size comes from the bot: each bot sizes every order from its own budget per entry.

What happens at the broker

  • The order goes to the bot's account at Charles Schwab, Tradier, tastytrade or Alpaca, or to Nyria Paper.
  • Its size comes from the budget per entry set on the bot, not from the message.
  • It's a market or limit order, as the strategy sets.
  • An identical alert body that repeats straight after the first is dropped, so a double send from TradingView doesn't open two positions.
  • Exits come from your exit alerts. Nyria doesn't attach a stop or a target to the entry.

Questions

Do I need a paid TradingView plan?
Yes. TradingView sends webhooks on its paid plans only, with two-factor sign-in turned on. Nyria itself is free to test on paper, with no card.
Does the alert message need a special format?
No. Plain text or JSON, in your own wording. Name the ticker and the side. The message Nyria shows in the Create the alert step works as it is, and a message you already use can stay.
Where is the webhook URL?
On the strategy's Integration tab, in the Create the alert step. It looks like https://trades.nyria.io/webhooks/ followed by a token that belongs to that strategy.
What if the webhook URL leaks?
Anyone with the URL can send alerts to the strategy. Select Rotate token on the Integration tab and paste the new URL into the TradingView alert.
Can I test without a broker account?
Yes. Nyria Paper is built in, free and has no time limit. Run up to 10 paper bots before any broker is connected.
What does live trading cost?
$100 a month per $10,000 of total entry allocation, with no per-bot fees.

Send your first alert to paper

Trade and test free on paper, forever. No card required.