Integrations
Toggle the public tunnel that lets TradingView reach the local webhook receiver. Only /api/integrations/* is exposed; every other route returns 403 from the tunnel.
ngrok tunnel
OffPublic URL
— tunnel inactive —
Webhook endpoint
enable the tunnel to get the URL
PID
—
Started
—
How it's scoped: the tunnel guard in
server.ts only allows requests on /api/integrations/* through public hosts. Terminal, options chain, baskets, settings, broker logs, recommendations — all return 403 from the tunnel. Same-origin (localhost) traffic is unaffected.Webhook tokens
0 active · 0 revoked| Label | Mode | Hits | Last fired | Created | Status | Action |
|---|---|---|---|---|---|---|
| No tokens yet — mint one above. | ||||||
Recent webhook alerts
No alerts yet. Fire a TradingView webhook (or run
scripts/test-tv-webhook.sh) and they appear here within 5 seconds.TradingView setup
- Enable the tunnel above; copy the Webhook endpoint URL.
- In TradingView, open any chart → Alerts (clock icon) → + Create Alert.
- Set your condition (Pine indicator output, price crossing, whatever fires the trade).
- Notifications tab → tick Webhook URL, paste the endpoint URL.
- Message field → one of the JSON payloads below. Replace the
secretwith one of your active token secrets (or the legacy env value), edit strike / side / lots / expiry, save the alert.
① Open a fresh position — BUY / SELL
{
"secret": "<your token secret>",
"action": "BUY",
"symbol": "NIFTY",
"strike": 24050,
"side": "CE",
"exchange": "NFO",
"lots": 1,
"expiry": "2026-05-12",
"orderType":"MARKET"
}action: "BUY" or "SELL". side: "CE" for call, "PE" for put. orderType: "MARKET" or "LIMIT" — for LIMIT add "price": 50.00.
② Open every leg of a basket (BUY-first ordering)
{
"secret": "<your token secret>",
"action": "OPEN_BASKET",
"basket": "my-iron-condor"
}basket = the basket's name in /orders. Legs are placed BUY-first so SPAN is charged at the spread rate.
③ Square off a single position
{
"secret": "<your token secret>",
"action": "CLOSE",
"symbol": "NIFTY",
"strike": 24050,
"side": "CE",
"exchange": "NFO",
"expiry": "2026-05-12"
}④ Square off every leg of a basket (SELL-first ordering — reverses entry)
{
"secret": "<your token secret>",
"action": "CLOSE_BASKET",
"basket": "my-iron-condor"
}basket = the basket's name in /orders. SELL legs close first so SPAN releases before the longs unwind.
⑤ Square off every open position (paper or live)
{
"secret": "<your token secret>",
"action": "CLOSE_ALL"
}Frequency: Once per bar close for most setups (avoids over-firing). Live orders require both a live-allowed token and an explicit"mode": "live" in the payload. Without that, even a live token falls back to paper.