Skip to main content

AI agents / bots

Two different jobs:

JobUse
Write TradingView Pine for TradePod webhooksPrompt + helpers below (or MCP tool get_tradingview_pine_helpers)
Chat with your live pod (positions, orders)Claude connector (MCP)
POST JSON like Postman / custom botREST contract on this page
  1. Copy the full prompt from Pine Script & extras → AI agents, or download tradepod-ai-prompt.txt.
  2. Paste into Claude / ChatGPT / Cursor and describe your strategy.
  3. 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 / lots unless 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, body key, or X-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​

StatusMeaning
400Bad JSON / missing price on entry / legs[] not supported
401Bad or missing API key
403Strategy disabled, TradingView off, or outside market hours
404Strategy 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.