TradingView to Zerodha and Fyers Automation: How It Works and Common Mistakes
How TradingView alerts become orders on Zerodha Kite Connect or Fyers: webhooks, a bridge server, static IP rules from April 2026, daily tokens and the mistakes to avoid.
By ThinkStak Engineering 7 min read
TradingView cannot place orders on Zerodha or Fyers by itself. An alert sends a webhook to a small server you control; that server checks the message, applies your quantity and risk rules, and places the order through Kite Connect or the Fyers API. Since 1 April 2026 the order must come from a static IP whitelisted with your broker, and the broker's access token has to be refreshed every trading day — so the "server in the middle" is not optional.
This guide explains each piece, what it costs, and the mistakes we see most often when traders automate TradingView strategies on Indian brokers.
How the pieces fit together
A working TradingView-to-broker setup has four parts:
- The TradingView alert. Your Pine Script indicator or strategy fires an alert with a message (usually JSON) such as symbol, side, quantity and a signal ID.
- The webhook. TradingView sends that message as an HTTP POST to a URL you provide. TradingView webhooks need a paid plan and two-factor authentication on your TradingView account.
- The bridge server. A small service on a VPS or cloud server receives the webhook, checks a secret token, maps the TradingView symbol to the broker's instrument, applies sizing and risk rules, and logs everything.
- The broker API. The bridge places, modifies or cancels the order through Zerodha Kite Connect or the Fyers API, then tracks the order until it is filled or rejected.
No-code platforms and third-party bridges do the same job for you. A custom bridge makes sense when you need your own risk rules, multiple accounts, several brokers, or full control of the logs.
What Zerodha Kite Connect and Fyers require
Zerodha Kite Connect has two plans. The free Personal plan includes order management but no live or historical market data; the paid Connect plan costs ₹500 per month per API key and adds data. For a TradingView bridge that only places orders, Personal is often enough, because the signal already comes from TradingView. Kite access tokens expire daily, so the bridge needs a login step every trading day.
Fyers API follows a similar flow: the user authorises the app, the app exchanges an authorization code for an access token, and that token is sent with each request. For the April 2026 rules, Fyers asks API users to whitelist a static IP in the API dashboard and activate the trading app.
The static IP rule from April 2026
Under SEBI's retail algo framework, effective 1 April 2026, API-based order placement must come from a static IP registered with the broker. In practice:
- Get a static IP from your internet provider, a VPS or a cloud provider, and run the bridge there.
- Whitelist it in the Kite Connect developer profile or the Fyers API dashboard. Zerodha notes that exchange rules allow only one change per calendar week, so check it carefully.
- A static IP can be shared with immediate family members under broker rules; it cannot be shared freely with unrelated people.
- Strategies that send orders very fast may also need exchange registration — see our guide to SEBI's retail algo trading rules.
This is why "run it from my laptop on home Wi-Fi" no longer works for order placement.
Common mistakes
These are the problems that cause wrong or missing orders:
- Duplicate orders. The same alert can fire more than once, or be created twice by mistake. Give every alert a unique ID and make the bridge ignore repeats.
- Symbol mismatches. TradingView's
NSE:NIFTYis not a tradable F&O contract. The bridge must map to the exact instrument — expiry, strike and option type for options — and update the mapping when contracts roll. - Lot size errors. F&O quantity must be a multiple of the lot size, and exchanges change lot sizes from time to time. Calculate quantity from the current instrument data, not a hard-coded number.
- Repainting or intrabar alerts. An alert set to fire "once per bar" can trigger on a price that later disappears. Use "once per bar close" when the strategy is built on closed candles.
- Expired tokens. If the morning login fails, every order that day fails. The bridge should check the session before market open and alert you if it is not valid.
- No reconciliation. Webhook delivery is not guaranteed. Log every alert and every order, and compare positions with the broker so a missed signal is noticed.
- Secrets in the alert. Never put broker passwords or API secrets in the TradingView message. Use a separate shared token that only proves the request came from your alert.
A setup checklist
- Paid TradingView plan with 2FA turned on
- Bridge server on a static IP, whitelisted with the broker
- Secret token checked on every webhook
- Unique signal ID; duplicates ignored
- Symbol and lot-size mapping from current instrument data
- Daily login and token check before market open
- Max quantity, max orders per day and daily loss limit in the bridge
- Every alert, order and fill logged; positions reconciled
- Tested with the smallest quantity before going live
When a custom build makes sense
Off-the-shelf bridges are fine for one account and a simple strategy. A custom build is worth it when you copy one strategy across several accounts or brokers, need options-specific logic (strike selection, expiry roll), want your own risk rules, or must keep complete records.
ThinkStak builds TradingView automation and broker integrations for Indian traders and firms — see algo trading software development in India, TradingView to broker automation and Zerodha, Fyers and XTS algo trading, or book a free audit.
ThinkStak builds trading software only. We do not provide trading signals, investment advice or regulatory advice.
