AI agents / bots
Two different jobs:
| Job | Use |
|---|---|
| Write TradingView Pine for TradePod webhooks | Prompt + helpers below (or MCP tool get_tradingview_pine_helpers) |
| Chat with your live pod (positions, orders) | Claude connector (MCP) |
| POST JSON like Postman / custom bot | REST contract on this page |
Write Pine Script (recommended helper)
- Copy the full prompt from Pine Script & extras → AI agents, or download
tradepod-ai-prompt.txt. - Paste into Claude / ChatGPT / Cursor and describe your strategy.
- Or, with Claude connector on and Allow analysis: ask Claude to call
get_tradingview_pine_helpers, then write the script from that contract.
Rules the helper enforces:
- Auth only on Webhook URL
?key=— never"key"in the JSON body - Required entry fields:
action,symbol,price - Optional:
sl/target/trail_sl(points ₹) only when > 0 - Separate
alert()for entry and exit - No
order_mode/qty/lotsunless you ask
Example scripts: Pine Script & extras.
REST bots (POST JSON)
Same contract as Postman. Keep the JSON small and deterministic.
Contract
- URL:
POST https://{pod}/strategy/{strategy_id}/eq?key={api_key}(or/fut//opt) - Body: see payload reference
- Auth: query
key, bodykey, orX-Api-Key/Authorization: Bearer
Recommended agent entry
{
"action": "BUY",
"symbol": "RELIANCE",
"security_id": 2885,
"price": 2950.5,
"sl": 2920,
"target": 3010,
"qty": 10,
"order_mode": "AUTO"
}
For F&O, always include security_id + exchange_segment, and use /fut or /opt.
Errors to handle
| Status | Meaning |
|---|---|
| 400 | Bad JSON / missing price on entry / legs[] not supported |
| 401 | Bad or missing API key |
| 403 | Strategy disabled, TradingView off, or outside market hours |
| 404 | Strategy or symbol not found / no open position to exit |
Idempotency
Identical buy/sell or exit JSON for the same strategy within ~1 hour returns { "success": true, "duplicate": true }.
MODIFY and FORCE_EXIT are not treated as duplicates.