Connect your broker. Automate everything.
Anadi Algo connects to NSE and BSE through official broker APIs. OAuth authentication, real-time order execution, position management, and TradingView webhook integration.
Supports Zerodha Kite Connect, Angel One SmartAPI, Upstox API, DhanHQ, and Stoxkart.
How broker API integration works
Indian stock brokers provide REST APIs for order placement, position management, and market data. Anadi Algo acts as an orchestration layer that connects your trading strategies to these broker APIs. The flow is: your strategy generates a signal, Anadi Algo translates it into an order request, and the order is placed through your broker's API.
Authentication uses OAuth 2.0 (Zerodha, Upstox) or API key + TOTP (Angel One, Dhan). Session tokens are renewed daily before market open. All credentials are encrypted at rest using AES-256.
Supported broker APIs
Technical details for each supported broker.
| Broker | API | Authentication | Data Feed | Order Types | Segments |
|---|---|---|---|---|---|
| Zerodha | Kite Connect v3 | OAuth 2.0 (request_token + access_token) | WebSocket tick data + REST historical candles | MARKET, LIMIT, SL, SL-M | NSE, BSE, NFO, CDS, MCX |
| Angel One | SmartAPI v2 | TOTP-based login + JWT token | WebSocket + REST candles | MARKET, LIMIT, SL, SL-M | NSE, BSE, NFO |
| Upstox | Upstox API v2 | OAuth 2.0 (authorization_code) | WebSocket + REST historical | MARKET, LIMIT, SL, SL-M | NSE, BSE, NFO |
| Dhan | DhanHQ API | API key + access token | REST option chain + WebSocket | MARKET, LIMIT, SL, SL-M | NSE, NFO |
| Stoxkart | Stoxkart API | API key + session token | REST candles | MARKET, LIMIT, SL | NSE, BSE |
TradingView webhook integration
Route TradingView alerts to auto-execute on NSE/BSE through your broker.
TradingView Alert fires
Your Pine Script indicator or chart alert triggers. Alert message contains symbol and action (BUY/SELL).
Webhook hits Anadi Algo
TradingView sends HTTP POST to your unique webhook URL. Payload includes alert message, symbol, and timestamp.
Symbol mapping applied
Source symbol (e.g., NIFTY) is mapped to broker instrument (e.g., NSE:NIFTY 50, exchange: NFO, qty: 50). You configure mappings once.
Order sent to broker
Anadi Algo places order via broker API (Zerodha/Angel One/etc). Execution controls apply: time window, rate limits, paper/live mode.
Confirmation logged
Order status, fill price, latency, and any errors are logged. View full webhook execution history in the dashboard.
Full TradingView webhooks guide with configuration details, symbol mapping, and execution logs.
What you can automate
Every aspect of trade lifecycle management.
Entry/Exit Execution
Automatic order placement when strategy conditions are met. Market, limit, and SL orders.
Stop Loss & Take Profit
Auto-place SL/TP orders immediately after entry. Percent, points, or absolute value modes.
Trailing Stop Loss
Dynamically adjust SL as price moves in your favor. Configurable trail distance and activation.
Position Sizing
Auto-calculate quantity based on capital per trade. Qty = capital / entry price.
Intraday Auto-Square-Off
Exit all intraday positions before market close (default 3:15 PM). Configurable per strategy.
Options Basket Execution
Multi-leg options orders: straddle, strangle, spreads. Place all legs simultaneously.
Scale Down
Partial position exit. Close 25%, 50%, or custom percentage of position.
Roll Positions
Roll options positions to next expiry. Close current leg, open next expiry leg in one action.
API endpoints overview
Key endpoints available on the Professional plan. JWT-authenticated, JSON responses.
| Method | Endpoint | Description |
|---|---|---|
| POST | /strategies/ai/generate | Generate strategy DSL from natural language prompt |
| POST | /strategies/validate-dsl | Validate strategy DSL syntax and indicator references |
| POST | /strategies/ai/save | Save validated strategy to your library |
| POST | /backtests | Launch backtest with strategy, instruments, date range |
| GET | /backtests/:id/results | Get backtest results: trades, equity curve, metrics |
| POST | /instances/deploy | Deploy strategy to paper or live trading |
| GET | /positions | List all open positions across strategies |
| GET | /orders | List all orders with status, fill price, timestamps |
| POST | /webhooks | Create TradingView webhook endpoint |
| GET | /scanner/signals | Get current AI scanner signals for all instruments |
Full API documentation available after sign-up.
Frequently asked questions
How do I connect my Zerodha account for algo trading?
Go to Settings in Anadi Algo, select Zerodha as your broker, enter your Kite Connect API key and secret, then click Login. You will be redirected to Zerodha for OAuth authorization. Once authorized, Anadi Algo receives a session token to place orders on your behalf. The session expires daily and needs re-login each morning.
Can I use TradingView alerts to auto-trade on NSE?
Yes. Create a webhook in Anadi Algo to get a unique URL. Add this URL to your TradingView alert. Configure symbol mappings to translate TradingView symbols to broker instruments. When the alert fires, Anadi Algo automatically places the order through your connected broker. Supports paper and live mode.
What API rate limits apply?
Anadi Algo respects broker API rate limits. Zerodha allows 3 orders per second, Angel One allows 10 requests per second. The platform queues orders if limits are hit. For webhooks, you can set custom rate limits (e.g., max 5 executions per minute) to prevent alert storms.
Is there a REST API I can use directly?
Yes, the Professional plan includes full API access. You can programmatically create strategies, launch backtests, deploy instances, manage positions, and configure webhooks. All endpoints use JWT authentication and return JSON responses.
Automate your NSE trading with API access
Start with paper trading. Connect your broker when you are ready to go live.