Register
Learn guide

TradingView Webhook Automation in India: How Chart Alerts Reach a Broker

People search for TradingView webhook automation to turn chart alerts into orders at their broker. A webhook sends an HTTP request to a URL you choose every time an alert fires, and that request can start an order through a broker's API. Whether you may do that depends on the tool that sends the alert, its terms, and SEBI's rules.

QuantPower Research · Updated 16 Nov 2026 · 20 min read

This guide explains API vs webhook, what TradingView's terms say about automated use of its alerts, the rules in India since April 2026, how a webhook server works if you build one for your own tools, and how Arth.live price alerts reach your QuantPower algo with no webhook at all.

API vs webhook

An API and a webhook are two directions of the same idea.

APIWebhook
Who starts itYour code calls the serviceThe service calls your URL
WhenWhenever your code decidesWhen something happens, such as an alert firing
Example in tradingYour code asks the broker for a quote or places an orderYour own scanner or script tells your server that an EMA crossed
What you need to runA program that calls the brokerA URL that is always reachable and answers quickly

A chart-to-broker setup uses both. The webhook carries the alert from the chart to your server; your server then calls the broker's API to place the order. The webhook decides when; the API does the trading. Because the webhook only carries a message, everything that makes the order safe, the contract, the quantity, the checks and the exit, has to live on the receiving side.

Can TradingView webhooks place orders at an Indian broker?

The technology allows it; TradingView's terms do not. The points that matter:

  • Manual trading. TradingView's trading panel lets you place orders by hand at the brokers that connect to it.
  • Automated use of alerts. TradingView's Terms of Use (Section 3) license its alerts and webhooks for display use only. Automated trading and automated order generation from them are not permitted, and neither are third-party products that claim compatibility with them or advertise them for that purpose.
  • Exceptions. Only a separate agreement with TradingView can allow it.
  • Consequences. The terms name account blocking and legal action.
  • India's rules. Separately, SEBI requires every automatic order to go through a broker's API, from a static IP registered with that broker.

Read TradingView's terms yourself before automating anything; this guide is not legal advice. QuantPower does not offer a TradingView bridge. Its route is Arth.live price alerts, described below.

A short history of webhooks in trading

The word "webhook" was coined in 2007 by the developer Jeff Lindsay for a simple idea: instead of a program asking a website again and again whether anything has changed, the website calls the program's URL when it does.1 Payment services, code hosts and chat tools adopted the pattern through the 2010s, and charting platforms followed by adding webhook URLs to their alerts, so a price or indicator condition on a chart could reach any server on the internet the moment it fired.

In India, the other half arrived as brokers opened trading APIs to retail clients in the mid-2010s. A retail trader could now draw a rule on a chart, send its alert to a small server, and have that server place the order with the broker. Platforms grew up to do the middle step for traders who did not want to run a server. The arrangement worked, but nobody outside the platform could tell which orders were algos or who had built the rules.

SEBI's circular of 4 February 2025 changed that. It treats any order placed through a broker's API as an algo order, requires a static IP registered with the broker, lets a trader's own algo run without exchange registration only below 10 orders a second, and requires anyone offering algos to others to be empanelled.2 NSE's implementation standards of May 2025 set the details, and the framework has applied to every broker since 1 April 2026.3 A webhook setup in India today has to meet those rules.

How webhook automation works

Flow from a chart alert through a webhook and your server to your broker's API and risk checks (illustration)
  1. The alert fires. A price level or an indicator condition in the tool that sends the alert becomes true.
  2. The tool sends a request. It posts your alert message to the webhook URL you set.
  3. Your server checks it. It confirms the request is genuine and the instruction is valid.
  4. Your server calls the broker. It places the order through your broker's API.
  5. The broker checks the order. Margin and risk checks run before the order reaches the exchange.

Arth.live price alerts: the same result without a webhook

An alert you set on an Arth.live chart can be linked straight to one of your QuantPower signals, as an entry or an exit. The chart, the alert and the order then sit in one account, with no server, no URL and no message to write, and the hit goes through the same checks as a call to a webhook URL: the signal's pause switch, its rate limit and duplicate guard, and every risk check of your account.

  • Price alerts fire when the price goes above or below a level, checked on live prices while the market is open.
  • Indicator alerts fire when a price or an indicator line goes above, below, or crosses a number or another line, checked once per closed candle on the timeframe you choose. They can use your own indicators written in Arth Script.
  • They run on QuantPower's servers, so your browser, phone or computer can be off.
  • They are free. Arth.live needs no paid plan; the algo a signal switches on is what costs tokens.
Several Arth.live charts on one screen inside QuantPowerSeveral Arth.live charts on one screen inside QuantPower
Several Arth.live charts on one screen inside QuantPower

The rest of this guide covers the webhook route, for your own scanners and scripts, and for traders who want to run their own server.

What the sending side usually requires

RequirementWhat to check
TermsCheck that the tool's terms allow automated use of its alerts
PlanSome tools offer webhook alerts only on paid plans
SecuritySome require two-factor authentication on the account before webhooks work
PortsUsually port 80 (HTTP) or 443 (HTTPS) only
Response timeYour server must reply within a few seconds, or the request is cancelled
Sending IPsSome services publish the IP addresses their alerts come from, so you can allow only those
Message formatUsually sent as JSON if the message is valid JSON, otherwise as plain text

These details differ by software and can change. Check the tool's own help pages and terms before you build.

Write the alert message

Send a JSON message with only what your server needs:

JSON
{
  "secret": "replace-with-a-long-random-string",
  "symbol": "NIFTY26NOVFUT",
  "action": "buy",
  "price": "26050",
  "sent": "2026-11-16T10:45:00+05:30"
}

Most tools that send alerts can fill parts of the message with live values when the alert fires, such as the symbol, the closing price of the bar, the time and the chart's timeframe. The placeholder names differ by software, so look them up in its help pages.

The sending tool's symbols often differ from your broker's. A continuous futures chart has one name for every month, while your broker calls each contract by its own symbol, such as NIFTY26NOVFUT for the November 2026 Nifty future. Put your broker's symbol in the message, as above, or map one to the other on your server.

Messages for options

Most Indian traders watch the Nifty chart but trade Nifty options. The alert should carry the signal, not the contract, and the server should choose the contract when the alert arrives:

  • Direction in the message, such as "action": "buy_call" or "buy_put".
  • Strike chosen on the server, such as the at-the-money strike of the nearest weekly expiry at the moment of the alert, rounded to the 50-point strike interval.
  • Quantity in lots, checked against a maximum on the server, never taken blindly from the message.
  • Expiry rules on the server, such as moving to the next expiry on the day before expiry, so an alert near the end of the week does not buy an option with hours to live.

Keeping the contract logic on the server means the alert never has to change when the expiry rolls.

An indicator rule that sends alerts

A common rule: buy when the 9-period EMA crosses above the 21-period EMA, and exit when it crosses back. On Arth.live, add both EMAs to the chart and set two repeating indicator alerts, one on the fast line crossing up through the slow line and one on it crossing down, each on closed candles. Link the first to your signal as entry and the second as exit.

If your own scanner or script sends the alerts instead, have it send the entry or exit message only once per closed candle, so a cross that appears and vanishes inside a candle sends nothing.

If your indicator is not built in, write it as an Arth Script indicator: describe it in plain words, Quanty writes it, and you review it before it is saved. Alerts can then use its lines like any other indicator's.

Build the receiving server

This Flask server accepts alerts, checks the secret and the symbol, and places the order through Zerodha's Kite Connect API.5 Other brokers' APIs work in a similar way. Our Python algo trading with Zerodha guide covers the login and order details.

Python
import hmac
import os

from flask import Flask, abort, request
from kiteconnect import KiteConnect

app = Flask(__name__)
kite = KiteConnect(api_key=os.environ["KITE_API_KEY"])
kite.set_access_token(os.environ["KITE_ACCESS_TOKEN"])  # renew every trading day

ALLOWED = {"NIFTY26NOVFUT": 65}  # symbols this server may trade, with quantity

@app.post("/alert")
def alert():
    data = request.get_json(silent=True) or {}
    if not hmac.compare_digest(str(data.get("secret", "")), os.environ["WEBHOOK_SECRET"]):
        abort(403)
    symbol, action = data.get("symbol"), data.get("action")
    if symbol not in ALLOWED or action not in ("buy", "sell"):
        abort(400)
    order_id = kite.place_order(
        variety=kite.VARIETY_REGULAR,
        exchange=kite.EXCHANGE_NFO,
        tradingsymbol=symbol,
        transaction_type=kite.TRANSACTION_TYPE_BUY if action == "buy" else kite.TRANSACTION_TYPE_SELL,
        quantity=ALLOWED[symbol],
        product=kite.PRODUCT_NRML,
        order_type=kite.ORDER_TYPE_MARKET,
        market_protection=-1,  # required for market orders through the API
    )
    return {"order_id": order_id}

To run it for real:

  • Use a cloud server with a static IP, and register that IP with your broker.
  • Run the app with a production server such as Gunicorn behind Nginx, with an HTTPS certificate on port 443.
  • If the tool that sends the alert publishes the IP addresses it sends from, allow only those through the firewall.
  • Log every alert and every broker response.
  • Answer the request at once and place the order in the background if your broker's API is slow, so the time limit is never hit.

Choosing alert conditions that suit automation

Not every alert that looks good on a chart works well as an automatic order. Conditions that suit automation share a few traits:

  • They fire on a closed bar. An alert that fires the moment a price touches a line can fire and then become untrue a second later. Waiting for the candle to close makes the order match what the chart shows afterwards. Arth.live indicator alerts work this way by design.
  • They fire rarely. An alert that fires twenty times a day on a 1-minute chart sends twenty orders, pays twenty sets of charges and is far more likely to hit a rejection or a duplicate. Most automated chart rules use 5-minute or longer candles.
  • They have a matching exit. Every entry alert needs an exit, whether a second alert, a stop on the broker's side or an algo's own stop and exit time. An entry with no exit is the most common way webhook setups lose money unexpectedly.
  • They are tested. The same rule should be backtested and run forward on live prices before it places real orders. A condition that looked good on a few remembered charts often fails on hundreds of past bars.

A worked example: a Nifty EMA alert to an options algo

Positions from manual orders, algos and signals in one list, each with its sourcePositions from manual orders, algos and signals in one list, each with its source
Positions from manual orders, algos and signals in one list, each with its source

This is a hypothetical setup, not a result, showing how the pieces connect in QuantPower.

The rule. When Nifty futures' 9-period EMA crosses above the 21-period EMA on 15-minute candles, buy the at-the-money call of the nearest weekly expiry. When it crosses back, exit.

The algo. In Algos, the trader builds an option algo with one rule leg: buy 1 lot of the ATM call, nearest weekly expiry, picked fresh at each entry. It has a stop of 30% on the premium, a target of 60%, and an exit time of 3:10 pm. It is set to run every trading day, and it starts off.

The signal. The trader creates a signal and links it to that algo.

The alerts. On the Arth.live Nifty futures chart, the trader sets two repeating indicator alerts on 15-minute candles: the upward cross linked to the signal as entry, and the downward cross linked as exit.

A day. At 10:45 am the upward cross happens. The entry hit switches the algo on for the day; the algo picks the ATM call at that moment and buys it. At 1:30 pm the call is up 40% but has not reached its target. At 2:15 pm the downward cross fires the exit hit; the algo stops and squares off. Had the exit alert never fired, the algo's own stop, target and 3:10 pm exit would still have closed the trade.

The alert decides when; the algo decides what, how much and how to get out. Each can be tested on its own, and the account's daily loss limit and Smart Exit sit above both.

Handling failures

A webhook setup has more moving parts than a trader placing orders by hand, and each can fail on its own. Plan for each one:

  • The alert does not arrive. The sending tool, your internet provider or your server can be down. Nothing tells you an order was not placed, so monitor your server and compare the sending tool's alert log with your server's log each day.
  • The alert arrives twice. Network retries and alerts that fire more than once per bar can send the same instruction again. Record the bar time and the action of each order, and ignore an exact repeat.
  • The broker session has expired. Broker access tokens end every day. An alert that arrives before the morning login places no order; your server should log it and warn you, not retry silently.
  • The order is rejected. Margin, price bands, freeze quantities and order-rate limits can all refuse an order. Log the broker's reason and decide in advance whether the server retries, waits or stops.
  • The entry fills but the exit does not. An exit alert that fails leaves a position open with no plan. The safest design keeps a stop loss on the broker's side as soon as the entry fills, so a failed exit alert is not the only protection.
  • The market is closed or the contract has expired. Alerts from charts that keep running after hours, or from a continuous futures chart after the contract you trade has expired, should be ignored by the server, not queued for the next morning.
  • Partial fills. A large order can fill in parts. The server should check the filled quantity before sending an exit, so it does not try to sell more than it bought.

Monitoring a webhook setup

A webhook setup needs a short daily routine, because its failures are silent.

  • Before the open: sign in to your broker for the day, check that the server or platform shows the session as signed in, and check that the signals you expect are switched on.
  • During the day: compare each alert that fired with the hit log or your server's log. An alert with no matching order is a problem to find now, not at the end of the month.
  • After the close: check that every position opened by an alert was closed, or is meant to be held, and that the day's orders match the day's alerts.
  • Each week: review rejections and duplicates, and adjust the rule, the quantity or the order type that caused them.
  • Each month: compare the live results of each alert-driven strategy with its backtest and forward test over the same weeks. A widening gap usually points to fills, costs or alerts that fire differently live.

Security checklist

  1. Use HTTPS so the message is encrypted in transit.
  2. Include a long random secret in the message and compare it in constant time, as the example does.
  3. Accept only the symbols and quantities you expect, and cap the quantity.
  4. Never put broker passwords, two-factor codes or access tokens in an alert message.
  5. Ignore repeated alerts, for example by recording the bar time and action of each order.
  6. Keep two-factor authentication on for both the sending tool's account and your broker.

Rules in India

An order your server places through your broker's API is an algo order under SEBI's retail algo framework.2

  • Static IP: orders must come from a static IP registered with your broker.
  • Order rate: your own algo can run without exchange registration if it sends fewer than 10 orders a second, for your account or your immediate family's.
  • Daily login: broker access tokens expire every day, so the server needs a new token each morning. An alert that arrives with an expired token places no order.
  • Market orders: brokers apply market protection to market orders from algos, and Zerodha rejects API market orders sent without a market protection value.4
  • Sharing: if you let other people use your setup, you become an algo provider, which needs empanelment with the exchanges.
Connecting a broker in QuantPower, with the daily sign-in shown on each broker's rowConnecting a broker in QuantPower, with the daily sign-in shown on each broker's row
Connecting a broker in QuantPower, with the daily sign-in shown on each broker's row

See SEBI's algo trading rules for the full framework.

Test before going live

  1. Send a test alert to a request-inspection service and check that the JSON is valid.
  2. Point the alert at your server and log the request without placing an order.
  3. Place orders with the smallest quantity during market hours.
  4. Check that exits work as well as entries.
  5. Watch the first full day with your broker's app open.

In QuantPower, the same steps are simpler: switch the algo on in Forward test once, then off, and every hit runs it on live prices with no real money until you move it to live.

Common problems

ProblemLikely causeFix
No request reaches the serverThe sending tool's plan does not include webhooks, or a required setting such as two-factor login is offCheck the tool's plan and webhook settings
The server receives text, not JSONThe message is not valid JSON, often because of smart quotes or a missing commaCheck the message in a JSON validator
Requests time outThe server takes longer than the sender allowsReply at once and place the order in the background
Orders rejected for IPThe server's IP is not registered with the brokerRegister the static IP
Orders stop after the first dayThe access token expiredLog in each trading day and update the token
Duplicate ordersThe alert fires more than once per barFire once per bar close and ignore repeats

What a webhook setup costs

  • Alert source: Arth.live alerts are free. Other tools may charge for webhook alerts; check their pricing and terms.
  • Server: a small cloud server with a static IP, if you run your own.
  • Broker: brokerage and statutory charges on every order, which can be more than everything else for a rule that trades often. Some brokers also charge for API access or live data; check your broker's page.
  • Platform: on QuantPower a signal or webhook itself is free, and an algo it starts costs 200 tokens per 28 days while it runs live, or 100 in Forward test, with orders inside the algo unlimited.
  • Your time: testing, monitoring and fixing failures, which is the cost most traders underestimate.

Your own server or a platform

Your own serverA platform such as QuantPower
SetupWrite and host the code, register the static IP, renew the token dailyLink an Arth.live alert, or call a signal's URL from your own tool; sign in to your broker each day
Static IPYours to rent and register2 static IPs free with every QuantPower account
What an alert can doWhatever your code doesStart or stop your own algos, with their legs, stops and exits
Risk checksYours to writeThe account's kill switch, daily loss limit and Smart Exit apply
CostServer rent and your timeA signal is free; an algo it starts costs 200 tokens per 28 days while it runs live

Your own server gives complete control and complete responsibility. A platform trades some flexibility for a setup that is already built and already inside the SEBI framework.

Signals and webhooks in QuantPower

Signal algos in QuantPower: each rule, the instrument, what happens when it fires and its on/off switchSignal algos in QuantPower: each rule, the instrument, what happens when it fires and its on/off switch
Signal algos in QuantPower: each rule, the instrument, what happens when it fires and its on/off switch

QuantPower's signals are created in the app. An Arth.live alert links to a signal directly. Your own tools, such as a scanner, AmiBroker, MetaTrader, a spreadsheet or a script, can call the signal's private webhook URL. Check that each tool's terms allow automated use of its alerts.

  1. Create a signal in Algos, under Webhooks. You can have up to 20, and each one is linked to up to 10 of your algos.
  2. Connect the alert. On Arth.live, pick the signal in the alert. From your own tool, call the signal's URL with its entry or exit message. An entry switches the linked algos on for the day and enters now; an exit stops them and squares off their positions.
  3. The algos do the trading. Each linked algo has its own legs, strike rules, stops, targets and exit time, so the alert decides when and the algo decides how. A hit needs no tap, because the algos are automated by design.
  4. Nothing happens outside the rules. Outside market hours, after an algo's exit time, or on a day it does not run, a hit does nothing, and the hit log says why. A hit never moves an algo from Forward test to live money, or from one broker to another.
  5. Check the hit log. It keeps the last 500 hits with the result of each. Each signal has a pause switch, a rate limit and a guard against duplicate hits.

Orders go to your own broker account through its official API, from the two static IPs that come with your account. "Live" on a signal means it is switched on; it does not mean real money.

Webhooks from other tools

Your own tools can call the same signals. Before connecting any third-party tool, check that its terms allow automated use of its alerts.

  • Scanners such as ChartInk can send a webhook when a stock enters a scan's results, which suits rules like "start the breakout algo when this scan finds a stock". Check that the scan's result maps to a contract your algo trades.
  • AmiBroker and MetaTrader can call a URL from a formula or an expert advisor, so a trader who has built rules there can send entries and exits without rewriting them.
  • Spreadsheets and scripts, such as a Google Sheets script or a small Python program, can call the URL on a schedule or when a calculation crosses a level.

Whatever the source, the same rules apply: test the alert with no money at risk, cap what one hit can do, and keep an exit that does not depend on the next alert arriving.

QuantPower's signal trading goes one step further: the condition itself, up to 20 conditions on any of the chart's 201 indicators, candle patterns or chart patterns, runs inside QuantPower on closed candles. The TradingView algo trading guide explains what TradingView alerts can and cannot do, and the Arth.live route.

Start with 500 free tokens

Connect your broker, build a strategy and test it on paper before a single live order goes out.

Where webhook trading is going

Webhook trading in India has moved from a grey area to a regulated one. Registered static IPs, daily logins, order-rate limits and empanelled providers are now the normal shape of a chart-to-broker setup, and brokers are adding their own alert endpoints. Charting and trading are also moving closer together: when the chart, the condition and the order run in one account, there is no webhook to fail between them. And AI assistants can now write the alert, the rule and even the server code, which makes the checks on this page, secrets, quantity caps, duplicate guards and exits that work, more important rather than less.

Frequently asked questions

Are TradingView webhooks free?

No. TradingView's webhook alerts are on its paid plans, and its terms license them for display use, not for automated orders. Arth.live alerts are free and link to QuantPower signals with no webhook.

Can I send TradingView webhooks to QuantPower?

No. QuantPower does not offer a TradingView bridge, because TradingView's terms do not permit automated orders from its alerts. Use Arth.live price alerts, which link straight to your signals.

What is the difference between an API and a webhook?

Your code calls an API to ask for data or place an order. A webhook works the other way: another service calls your URL when something happens, such as an alert firing. A chart-to-broker setup uses both: the webhook calls your server, and your server calls the broker's API.

Is TradingView webhook trading legal in India?

SEBI allows algo orders through your broker's API within its rules: a registered static IP, a daily login and, for your own algo, fewer than 10 orders a second without registration. Separately, TradingView's own terms restrict automated use of its alerts and webhooks, so read them before automating anything.

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

The order is not placed. Monitor the server, keep a stop loss on the broker's side for open positions, and be ready to place or exit trades from your broker's app.

Can I trade options from a Nifty chart alert?

Yes. The alert can fire on the Nifty chart while your server, or a QuantPower algo linked to the signal, chooses the option contract, such as the at-the-money strike of the nearest expiry, and places that order.

Can one alert start several strategies at once?

In QuantPower, yes: one signal can be linked to up to 10 algos, and an entry hit switches all of them on for the day. On your own server, one alert can trigger as many orders as your code sends, within the 10-orders-a-second limit.

Can I use a scanner such as ChartInk?

Yes, if the scanner can call a URL when a stock appears in its results. The webhook then starts or stops your algos in the same way. Make sure the algo knows which stock or contract to trade when the alert names one.

Do alerts need my computer to be on?

Not with a platform: Arth.live alerts are checked on QuantPower's servers, and QuantPower's signals and algos keep working with your phone or computer off. With your own server, the server must be running and reachable during market hours.

References

  1. Lindsay, J. (2007). "Web hooks to revolutionize the web", blog post introducing the term webhook
  2. SEBI, circular on safer participation of retail investors in algorithmic trading, 4 February 2025, and glide-path circular, 30 September 2025 (sebi.gov.in)
  3. NSE, implementation standards for retail algo trading, 5 May 2025, and operational modalities, 22 July 2025 (nseindia.com)
  4. Kite Connect forum, "Preparing to comply with SEBI's retail algo rules (Static IP, ratelimits, order types)" (kite.trade), checked 20 October 2026
  5. Zerodha, Kite Connect API documentation (kite.trade)
  6. QuantPower and Arth.live: alerts, signals and prices, from the app's code and price list, checked 15 November 2026
  7. TradingView, Terms of Use, Section 3 (tradingview.com/policies), checked 16 November 2026
  8. TradingView: its plan pages on webhook alerts (tradingview.com), checked 20 October 2026
TradingView and Pine Script are trademarks of TradingView, Inc. QuantPower is an independent service and is not affiliated with, sponsored by, or endorsed by TradingView. This page is for information only and is not investment or legal advice. The code here is for learning. Test it with small quantities before relying on it. Trading involves substantial risk.