Skip to content
NyriaDocs
Set up your source

Connect TradingView alerts to Nyria

Set up a TradingView webhook alert for a Nyria strategy: add the script, create the alert, check the format, send a test, and fix common mistakes.

Watch the setup

4:03
  1. 0:00Pick Nyria Paper or a broker
  2. 0:58Create a strategy
  3. 1:27Create the alert in TradingView
  4. 3:12Check the format
  5. 3:31Deploy a bot

TradingView sends an alert to Nyria as a webhook. Put the script on a chart, paste your strategy's alert message and webhook URL into a new alert, then select Check format in Nyria. The free TradingView plan can't send webhooks, so you need a paid plan with two-factor authentication on.

Prerequisites

  • A Nyria strategy with TradingView as the alert source. If you have none, follow the quick start first.
  • A connected broker. See the broker pages: Charles Schwab, Tradier, tastytrade, Alpaca.
  • A paid TradingView plan with two-factor authentication on. The free plan can't send webhooks.

Step 1: Add the script to a chart

Open the symbol you trade in TradingView, at the timeframe you trade.
In the Pine editor, select Add to chart. Check the arrows show where you expect.
If arrows show late, disappear, or sit on bars that never fired live, the script repaints. Fix it first: see TradingView repainting.

The same chart's Strategy Tester can go on your strategy's page too. See add a backtest.

Step 2: Create the alert

On your strategy in Nyria, open the Integration tab. Script type asks whether your script is a Strategy or an Indicator. Create the alert then lists every step of TradingView's alert dialog for each alert your strategy needs, with the alert name, message and webhook URL to copy. If your script sends its own message, select Use my own format on the Message step.

An indicator() script needs a separate alert for each condition on each ticker. Convert it to a strategy first with convert an indicator to a strategy, so one Order-fills alert covers every side.

For each alert, in TradingView:

Open the ticker with your script on the chart.
Open the alert dialog: select Alert on the top toolbar, or press Alt + A (⌥ + A on Mac).
Set Condition to your strategy. In the second dropdown under it, choose Order fills only. The default also sends the script's alert() calls as extra messages. For an indicator, set Condition to your indicator and the alert condition for this side. Leave Interval on your chart's timeframe. If your script sends its own messages, choose alert() function calls only for a strategy, or Any alert() function call for an indicator.
For an indicator, set Trigger to Once per bar close. A strategy alert has no Trigger setting.
Set Expiration as far out as your plan allows, and set a reminder to renew. An expired alert stops firing without warning.
Open Message, set Alert name to the name from Nyria, replace the text in Message with the message from Nyria, then select Apply. On your own format, fill in Alert name and leave Message as it is.
Open Notifications, tick Webhook URL and paste your Nyria webhook URL in the field under it. TradingView remembers the last URL, so replace any URL already there. Select Apply.
Select Create.

Tick each step in Nyria as you go. A card is marked set up on its own once Nyria receives an alert of its kind.

Keep the webhook URL private. Anyone with it can send alerts to your strategy. If it leaks, select Rotate token on the Integration tab and paste the new URL into your alert.

Each webhook takes 10 alerts at once, then 1 a second. An alert over that limit is dropped with a 429.

Step 3: Check format

Back in Nyria, select Check format. On Nyria's format the messages are already filled in. On your own format, paste one message your script sent for each side.
Select Check and save. The strategy turns Active when every side passes.

Send a test alert

To test the webhook without waiting for TradingView, send this with your webhook URL. Bots on the strategy act on it, so test while only a paper bot is deployed.

curl -X POST '<your webhook URL>' \
  -H "Content-Type: application/json" \
  -d '{
    "ticker": "SPY",
    "action": "buy",
    "marketPosition": "long",
    "prevMarketPosition": "flat",
    "price": 771.20
  }'

It returns 200 OK with "status": "processed", and the alert shows on the strategy's Logs tab.

About Once per bar close

On an indicator alert, use Once per bar close. Once per bar can fire twice in one bar and send conflicting orders, and Once only stops after the first alert.

Common pitfalls

1. Duplicate alerts

Symptoms: two webhook hits within a second of each other, and the broker shows two opens instead of one.

Causes, most common first:

  • The TradingView alert is set to Once per bar instead of Once per bar close.
  • Two alerts on the same chart for the same strategy, for example a cloned alert whose original was never deleted. Open the Alert manager on the right toolbar and delete the copy.
  • Your Pine code calls alert() in a block that runs on every tick. Wrap the call in if barstate.isconfirmed.

Nyria drops an identical alert body repeated within 30 seconds, or within 5 minutes with no other alert in between. To place a second order on the same bar (scaling in, for example), make each body different. A unique metadata.message_id is the simplest way:

{
  "ticker": "SPY",
  "action": "buy",
  "metadata": { "message_id": "{{timenow}}" }
}

2. Wrong webhook token

Symptoms: 404 Not Found in TradingView's alert log, or 400 Bad Request if the token was copied with a stray space.

Causes:

  • The token was copied with a leading or trailing space. Use Nyria's copy button instead of selecting the URL by hand.
  • The strategy's token was rotated. Open Integration, copy the new URL, and update every TradingView alert that points at this strategy.
  • You pasted the strategy's public share URL (starting https://app.nyria.io/share/...) instead of the webhook URL. Only the trades.nyria.io/webhooks/... URL accepts POSTs.

3. Market order when you wanted limit, or vice versa

Symptoms: orders fill at a worse price than expected, or never fill and time out.

Causes:

  • The payload sends action (OPEN or CLOSE) and direction with an order_type that differs from the strategy's. On that shape the field in the alert overrides the strategy. Remove order_type from the payload or change the strategy.
  • The payload is a position change (marketPosition and prevMarketPosition) and sets order_type. Nyria doesn't read order_type on that shape, so the strategy's order type applies. Set the order type on the strategy. See when Nyria reads order_type.
  • Your strategy is set to Limit order but the payload has no price. If the strategy's Limit target is Alert price, the alert is rejected. Otherwise Nyria uses the set target (bid, ask, mid or custom). Send price whenever you mean a specific one.
  • You sent "price": {{close}} on a low-liquidity symbol and the bar close is far from the current quote. Add a slippage buffer in your Pine code, or switch to market for low-liquidity tickers.

4. A placeholder arrives instead of the symbol

Symptoms: the strategy's Logs tab shows an entry refused for a symbol that reads {{syminfo.ticker}}, {{tickerid}} or similar, with the braces still in it.

TradingView substitutes only the placeholders it publishes and passes every other one through as literal text. A Pine variable name is not an alert placeholder: inside alert() you concatenate the value ('{"instrument":"' + syminfo.ticker + '"}'), while in the alert dialog's Message box you use {{ticker}}. Mix the two and Nyria gets the braces, not a symbol.

Fix it in the alert message. Adding the placeholder to the strategy's tickers does not help. See TradingView alert messages for every placeholder Nyria's check fills in.

5. Repainting strategies

Symptoms: the backtest wins 90% of its trades, and the same strategy loses money live.

The script shows entries that never fired live. Read TradingView repainting, then check your script fires on barstate.isconfirmed and reads higher-timeframe data as close[1].

Going from paper to live

Run the strategy on paper for at least 1–2 weeks. Compare every fill in the strategy's Logs tab with TradingView's alert log, to catch dropped or doubled alerts early.

In My bots, pause the bot on the paper account.

Deploy a new bot on the same strategy to your live broker account. The webhook URL stays the same.

The new bot is Active as soon as it deploys. The next TradingView alert goes to the live broker.

Next steps

Your edge, on autopilot.

Trading carries risk. Read the risk disclosure.

© 2026 Nyria LLC. All rights reserved.