ProAlgoProAlgo
FeaturesBlog

Home › Blog › Automation

TradingView Webhook Automation in India: The Complete Guide

Updated 18 Oct 2026·14 min read

TradingView is where many Indian traders build and test their ideas. A webhook is the bridge that turns a TradingView alert into an actual order with your broker. This guide explains how the whole chain works, how to set it up step by step, and how to do it safely and within the rules.

The short version

A TradingView alert sends a message to a web address (the webhook). A platform or server reads that message, checks it against your risk rules and places the order through your broker's API. TradingView never touches your broker or your money. Most problems come from bad message formats, symbol mismatches, slow responses and missing risk limits, not from TradingView itself.

1. What is a webhook, in simple words?

A webhook is an automatic message sent from one app to another when something happens. When your TradingView condition triggers, TradingView sends an HTTP POST request containing your alert message to a URL you provide. Whatever is listening at that URL can then act on it.

TradingView itself only sends the signal. It does not place orders on NSE, BSE or MCX. Something else has to receive the signal and trade, and in India that "something" must trade through your broker's regulated API.

2. The full chain, end to end

Each link can fail, and each needs its own protection. A signal can be late, a message can be malformed, a symbol can be wrong, a risk limit can block the order, or the broker can reject it. Good automation expects all of this and handles it calmly.

3. What you need before you start

4. Setting up the alert, step by step

  1. Open the chart with your indicator or strategy applied, and click Alert (the clock icon).
  2. Choose the condition. Pick your indicator or strategy, and the exact signal you want to trigger on.
  3. Set the trigger. For most strategies choose Once Per Bar Close. This avoids signals that appear and disappear while a candle is still forming.
  4. Set the expiration. Make it open-ended if your plan allows it, or note the date so the alert does not silently stop working.
  5. Write the message. Use a JSON message with placeholders (explained in section 5).
  6. Open the Notifications tab, tick Webhook URL and paste your endpoint address.
  7. Save the alert, then test it with the smallest possible quantity or in paper mode before going live.

5. Designing the alert message (the payload)

TradingView sends whatever you type in the message box. If the text is valid JSON, it is sent as JSON, which is much easier for a platform to read than free text. A typical message looks like this:

{
  "secret": "YOUR_PRIVATE_TOKEN",
  "symbol": "{{ticker}}",
  "exchange": "{{exchange}}",
  "action": "{{strategy.order.action}}",
  "quantity": "{{strategy.order.contracts}}",
  "price": "{{close}}",
  "time": "{{timenow}}",
  "strategy_id": "nifty-breakout-01"
}

The double curly brackets are placeholders. TradingView fills them in with live values when the alert fires.

FieldWhat it does
secretA private token your endpoint checks, so random people cannot trigger orders.
{{ticker}} / {{exchange}}The instrument and exchange as TradingView names them. You will map these to your broker's names.
{{strategy.order.action}}"buy" or "sell" from a Pine strategy.
{{strategy.order.contracts}}The quantity the strategy wants. Many traders ignore this and let the platform decide quantity from risk rules instead.
{{close}}, {{timenow}}Price at the bar close and the exact alert time. Useful for logs and for rejecting stale alerts.
strategy_idYour own label, so one account can run several strategies without confusion.

Keep it simple. The message should say what happened (buy, sell, exit, which strategy). Your platform should decide how much and whether it is allowed.

6. Indicator alerts vs strategy alerts

Indicator alerts

You define an alertcondition() or alert() in the script and write the message yourself. You get full control, but you must handle entries, exits and position state on your side.

Strategy alerts

A Pine strategy places simulated orders on the chart, and the alert reports each order with placeholders such as {{strategy.order.action}} and {{strategy.market_position}}. This is convenient for backtested systems, but remember that the chart's simulated fills are not real fills.

Avoid repainting

Some indicators change their past signals as new data arrives. A backtest then looks perfect, but live alerts disagree with it. Use confirmed bar values and trigger once per bar close, and compare live alerts with the chart for a few days before trusting the system.

7. Symbols and instruments in Indian markets

This is where many first setups fail. TradingView and your broker use different names for the same instrument.

8. Risk controls: the part you must not skip

A webhook will happily send the same signal ten times if you configure it badly. Put limits between the alert and the broker:

Slippage and delay are real

Between the bar close, the alert, the webhook and the broker, a few seconds can pass. In fast markets the price you get can differ from the price on your chart. Backtests rarely include this, so test live with small size first.

9. Security basics

10. How this fits the SEBI and NSE algo rules

A TradingView alert by itself is only a message. The rules apply to the second step: the system that turns the message into an order through your broker's API. Under the retail algo framework, that means the order must go through a broker-approved setup, from a registered static IP, with broker risk checks and an Algo-ID on the order.

This also explains why TradingView cannot send orders directly to your broker: its servers are not your registered IP, and your broker is responsible for what trades on your account. Ask your platform and broker how this part is handled before going live, and read our algo trading rules guide for the details.

11. Common problems and how to fix them

ProblemLikely causeFix
Alert never firesAlert expired, condition never met, or plan limitsCheck the alert list, expiry and the exact trigger setting.
Alert fires but no orderEndpoint down, wrong URL, bad secret, or a risk rule blocked itCheck endpoint logs and the platform's rejection reason.
Webhook not receivedWrong port, no HTTPS, 2FA off, or slow responseUse HTTPS on 443, enable 2FA, reply within three seconds.
Message not understoodInvalid JSON, stray quotes or missing commasValidate the JSON in a checker before saving the alert.
Wrong instrument tradedSymbol mapping or expiry roll problemReview the mapping table and rollover rule.
Duplicate ordersTrigger set to every tick, or repeated signalsUse once per bar close and enable duplicate protection.
Live results differ from backtestRepainting, slippage, delay or feesUse confirmed bars, add costs to the backtest, compare live logs.

12. A safe rollout plan

  1. Paper trade first. Run alerts into a test or paper environment for at least a week.
  2. Compare every alert with the chart signal. They should match exactly.
  3. Go live with minimum quantity. One lot, or the smallest size possible.
  4. Watch the first sessions manually. Be ready to use the kill switch.
  5. Review the logs weekly. Look for rejected orders, delays and unexpected fills.
  6. Scale slowly. Increase size only after consistent, boring behaviour.

13. Frequently asked questions

Do I need to know coding to use TradingView webhooks?

Not necessarily. You need to write a clear alert message, and a no-code platform can handle the rest. If you build your own endpoint, you will need some programming.

Can TradingView place orders directly with my Indian broker?

Not through a webhook. A webhook only sends a message. Something else must receive it and place the order through your broker's API.

Can I use a free TradingView account?

No. Webhook alerts need a paid plan, and two-factor authentication must be on.

Is automating TradingView alerts legal in India?

Yes, when the orders go through your broker's official API under the SEBI and NSE retail algo framework. The practical details are in our rules guide.

How fast is the whole process?

Usually a few seconds from the alert to the broker, but it depends on your platform, the broker and market conditions. Do not design strategies that need millisecond precision on this route.

What happens if my server is down when an alert fires?

The alert is usually lost, because TradingView does not keep retrying forever. Use a reliable host, monitor uptime and have a plan to handle missed signals, such as checking open positions at start of day.

14. References

Check the latest details

TradingView features, plan names and limits, and broker or exchange rules can change. This article is an educational summary, not legal or investment advice. Always confirm current details with TradingView, your broker and official regulator websites.

Turn your TradingView alerts into risk-controlled orders

ProAlgo is a technology platform for multi-broker execution, TradingView webhooks, backtesting and a built-in risk engine.

See plans

Risk disclosure: Trading in securities, derivatives and commodities involves substantial risk and may result in loss of capital. Past performance does not guarantee future results. This content is for education only and is not investment advice or a recommendation to buy or sell.