AI-powered algorithmic trading for Indian markets
API Integration

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.

API Reference — Key Endpoints
POST/strategies/ai/generate
NL → Strategy DSL
POST/backtests
Launch backtest
POST/instances/deploy
Deploy to paper/live
GET/positions
Open positions
GET/orders
Order history
POST/webhooks
Create webhook
GET/scanner/signals
Scanner signals

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.

BrokerAPIAuthenticationData FeedOrder TypesSegments
ZerodhaKite Connect v3OAuth 2.0 (request_token + access_token)WebSocket tick data + REST historical candlesMARKET, LIMIT, SL, SL-MNSE, BSE, NFO, CDS, MCX
Angel OneSmartAPI v2TOTP-based login + JWT tokenWebSocket + REST candlesMARKET, LIMIT, SL, SL-MNSE, BSE, NFO
UpstoxUpstox API v2OAuth 2.0 (authorization_code)WebSocket + REST historicalMARKET, LIMIT, SL, SL-MNSE, BSE, NFO
DhanDhanHQ APIAPI key + access tokenREST option chain + WebSocketMARKET, LIMIT, SL, SL-MNSE, NFO
StoxkartStoxkart APIAPI key + session tokenREST candlesMARKET, LIMIT, SLNSE, BSE

TradingView webhook integration

Route TradingView alerts to auto-execute on NSE/BSE through your broker.

Webhook Execution Flow
1

TradingView Alert fires

Your Pine Script indicator or chart alert triggers. Alert message contains symbol and action (BUY/SELL).

2

Webhook hits Anadi Algo

TradingView sends HTTP POST to your unique webhook URL. Payload includes alert message, symbol, and timestamp.

3

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.

4

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.

5

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.

API Reference (selected endpoints)
MethodEndpointDescription
POST/strategies/ai/generateGenerate strategy DSL from natural language prompt
POST/strategies/validate-dslValidate strategy DSL syntax and indicator references
POST/strategies/ai/saveSave validated strategy to your library
POST/backtestsLaunch backtest with strategy, instruments, date range
GET/backtests/:id/resultsGet backtest results: trades, equity curve, metrics
POST/instances/deployDeploy strategy to paper or live trading
GET/positionsList all open positions across strategies
GET/ordersList all orders with status, fill price, timestamps
POST/webhooksCreate TradingView webhook endpoint
GET/scanner/signalsGet 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.