Skip to content

Guide

TradingView webhook without localhost or ngrok

TradingView posts each webhook from its own servers to a public address, so it cannot reach localhost. A local server needs a tunnel such as ngrok, or a host, and it has to stay on. With Nyria there is nothing to run: each strategy has a hosted webhook URL at trades.nyria.io. You paste it into the alert's Webhook URL box and the alert reaches a bot that places the order at your broker, or on Nyria Paper first.

Official documentation

Receive webhooks with no server

  1. 1

    Create a strategy

    In Nyria, select Create strategy and pick TradingView as the alert source. Choose the asset type and set what an entry and an exit do on each side.

  2. 2

    Copy the hosted URL

    Open the strategy's Integration tab and copy the webhook URL. It is https://trades.nyria.io/webhooks/ followed by a token that belongs to the strategy.

  3. 3

    Paste it into the alert

    In the TradingView alert dialog open Message, paste the strategy's message and select Apply. Open Notifications, tick Webhook URL, paste the URL and select Apply, then Create.

  4. 4

    Fire a test, read the log

    When the alert fires, the Logs tab on the strategy shows the ticker and side Nyria read. Test while only a paper bot is deployed.

Watch the setup

How to automate TradingView alerts to your broker (free paper account first)
Start on free Nyria Paper and build a TradingView strategy. Check the alert format, deploy a bot.
Steps in the video
  1. 0:00Pick Nyria Paper or a broker. Open Integrations. Nyria Paper is free and needs no broker, so start there. Charles Schwab, Tradier and tastytrade connect through their own sign-in, and Alpaca takes an API key.
  2. 0:58Create a strategy. Select Create strategy and name it. Then, select your alert source. This example uses TradingView. Pick stocks and a ticker, then create the draft.
  3. 1:28Create the alert in TradingView. Copy the webhook URL and the alert message from the Integration tab. In TradingView, select Message, paste the message and select Apply. Then select Notifications, tick Webhook URL, paste the URL and select Apply.
  4. 3:13Check the format. Select Check format and add an entry and an exit alert. Nyria shows the ticker, side and order it read.
  5. 3:32Deploy a bot. Select Deploy bot, set a budget per entry and pick an account. Nyria Paper is free, so test there first. On a live broker account, pick it on the Account step. Send a sample alert and watch the paper order fill.

What TradingView requires

  • Only ports 80 and 443 are accepted, so a tunnel has to forward from one of them.
  • A server that takes longer than three seconds to process a request has the request cancelled.
  • IPv6 is not supported for webhooks.
  • Webhook alerts are allowed only with two-factor sign-in turned on, on a paid TradingView plan.

Keep the URL private

  • The token in the URL is the only authentication, so anyone who has the URL can post to the strategy.
  • Select Rotate token on the Integration tab to replace it, then paste the new URL into the alert.

Questions

Can TradingView send a webhook to localhost?
No. TradingView sends it from its own servers, which cannot reach an address on your machine. It needs a public address on port 80 or 443.
Do I need ngrok with Nyria?
No. The webhook URL is hosted, so you run no server and no tunnel.
Does my firewall need to allow anything?
No. The hosted address is not on your network. Allowlisting TradingView's addresses only matters on a server you run yourself.
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.