TradingView alerts to auto-trade on NSE
Connect TradingView Pine Script alerts to auto-execute on NSE and BSE. Symbol mapping translates TV symbols to broker instruments. Rate limiting prevents alert storms. Paper mode for testing, live mode for real execution.
Also supports Chartink screener alerts and custom HTTP bots. Works with Zerodha, Angel One, Upstox, Dhan.
How to set up TradingView webhooks
Five steps from TradingView alert to auto-execution on your broker.
Create webhook in Anadi Algo
Go to Webhooks page. Click "New Webhook". Name it, select platform (TradingView/Chartink/Custom), choose broker, set trading mode (Paper/Live). You get a unique URL and secret key.
Add symbol mappings
Map source symbols to broker instruments. TV sends "NIFTY" but your broker needs "NIFTY 50" on NFO exchange with quantity 50. Set action: FOLLOW (same direction) or REVERSE (opposite).
Configure execution controls
Set trading window (e.g., 09:20-15:15), rate limits (e.g., max 5 per minute), and order type (Market/Limit). These prevent accidental over-trading and out-of-hours execution.
Add URL to TradingView alert
In TradingView, create or edit an alert. Under "Notifications", check "Webhook URL" and paste your Anadi Algo webhook URL. Set the alert message format.
Test with paper mode
Start with paper trading mode. Fire a test alert from TradingView. Check the webhook logs in Anadi Algo to verify the full flow works. Switch to live when satisfied.
Webhook configuration
What a configured webhook looks like in Anadi Algo.
{
"symbol": "NIFTY",
"action": "BUY",
"secret": "your_secret"
}Symbol mapping
TradingView uses different symbol names than brokers. Mappings translate source symbols to the correct broker instrument, exchange, and quantity.
| Source (TV) | Target (Broker) | Exchange | Qty | Action | Note |
|---|---|---|---|---|---|
| NIFTY | NIFTY 50 | NFO | 50 | FOLLOW | TV says BUY → Anadi buys |
| BANKNIFTY | NIFTY BANK | NFO | 15 | FOLLOW | Direct mapping |
| RELIANCE | RELIANCE | NSE | 10 | FOLLOW | Equity segment |
| SBIN | SBIN | NSE | 25 | REVERSE | TV says BUY → Anadi sells |
| HDFCBANK | HDFCBANK | NSE | 15 | FOLLOW | Equity segment |
Execution controls
Safety guardrails to prevent accidental over-trading and out-of-hours execution.
Trading Window
Only execute orders within specified time range
09:20 - 15:15 ISTRate Limiting
Max number of executions per time period
5 per minute, 50 per dayDuplicate Prevention
Ignore duplicate alerts within cooldown period
1 second cooldown per symbolPaper/Live Toggle
Switch between paper and live without changing TV alerts
Paper mode for testingOrder Type
Market or limit orders for webhook execution
MARKET (default), LIMITSecret Validation
Verify webhook secret to prevent unauthorized requests
HMAC-SHA256 signature checkWebhook execution logs
Every webhook execution is logged with status, latency, and order details.
| Time | Symbol | Action | Status | Latency | Order ID | Detail |
|---|---|---|---|---|---|---|
| 09:21:03 | NIFTY | BUY | SUCCESS | 142ms | ORD-2026030801 | Market order placed, filled at 22,845.50 |
| 09:45:18 | NIFTY | SELL | SUCCESS | 118ms | ORD-2026030802 | Exit order, filled at 22,892.00 |
| 10:12:45 | RELIANCE | BUY | SUCCESS | 156ms | ORD-2026030803 | Market order, filled at 1,245.30 |
| 10:12:46 | RELIANCE | BUY | RATE_LIMITED | — | — | Duplicate alert within 1s, rate limited |
| 10:30:02 | SBIN | BUY | SUCCESS | 134ms | ORD-2026030804 | Reversed to SELL (mapping), filled at 812.40 |
| 15:16:30 | NIFTY | BUY | REJECTED | — | — | Outside trading window (15:15 cutoff) |
Supported alert platforms
TradingView is the most popular, but any HTTP source works.
TradingView
Pine Script alerts, chart alerts, and screener alerts. Most popular source of webhook signals.
JSON or plain text alert messageChartink
Indian stock screener with scan-based alerts. Trigger when stocks enter/exit your scan.
HTTP POST with stock listCustom Bots
Any system that can send HTTP POST requests. Python scripts, Node.js bots, Google Sheets macros.
JSON payload with symbol + actionFrequently asked questions
How do I connect TradingView alerts to auto-trade on Zerodha?
Create a webhook in Anadi Algo with Zerodha as the broker. You get a unique URL. Add this URL to your TradingView alert under Notifications > Webhook URL. Add symbol mappings (e.g., NIFTY → NIFTY 50, NFO, qty 50). When your TV alert fires, Anadi Algo places the order on Zerodha via Kite Connect API.
Can I use TradingView free plan with webhooks?
No. TradingView webhooks require a paid plan (Essential or higher). The webhook URL feature is not available on the free TradingView plan. However, you can use Chartink alerts or custom bots with Anadi Algo webhooks on any plan.
What happens if TradingView sends duplicate alerts?
Anadi Algo has built-in rate limiting and duplicate prevention. If the same symbol receives the same action (BUY/SELL) within the cooldown period (default 1 second), the duplicate is rejected and logged as RATE_LIMITED. You can configure the cooldown period.
Can I auto-trade on multiple brokers from one TradingView alert?
Yes. Create multiple webhooks in Anadi Algo, each connected to a different broker. Add all webhook URLs to your TradingView alert (TradingView supports multiple webhook URLs per alert on higher plans). Each webhook processes independently with its own symbol mappings and controls.
Related pages
NSE Algo Trading API
Full API reference for strategies, backtests, orders, and positions. REST endpoints with JWT auth.
NSE Algo Trading API →Supported Brokers
Zerodha, Angel One, Upstox, Dhan, Stoxkart. API details, segments, and connection flow.
Supported Brokers →Strategy Builder
Build strategies with AI Chat Wizard or DSL Builder. 30+ indicators, English and Hindi.
Strategy Builder →Turn your TradingView alerts into real trades
Set up in 5 minutes. Test with paper mode. Go live when ready.