Back to Blog
4 min read

Pine Script Alerts to IBKR: Webhook Checklist for Options

Field-by-field checklist for sending TradingView Pine alerts to IBKR via webhook relays — symbology, paper testing, duplicates, and when to use chart-native tools instead.

Pine Script alerts to IBKR work by posting structured JSON from TradingView to a webhook relay, which maps fields to IBKR TWS API orders — validate symbology and paper trade before live options automation.


End-to-end path

Pine strategy / indicator
        ↓ alert() on condition
TradingView servers → HTTPS POST
        ↓
Your relay (PickMyTrade, TradersPost, custom)
        ↓
IBKR Client (TWS / Gateway API)
        ↓
US options matching

IBKR API background: IBKR API. TradingView alerts: Creating alerts.


Pine alert design rules

1. Fire frequency

alert.freq styleUse case
Once per bar closeReduce duplicate fires on intrabar noise
Once per barFaster but noisier

Document your choice in the strategy readme — relays rarely fix bad alert cadence.

2. Message contract (template)

Define a frozen JSON schema your relay expects. Example illustrative shape (relay-specific — do not copy blindly):

{
  "action": "buy",
  "symbol": "SPY",
  "expiry": "20260620",
  "strike": 500,
  "right": "C",
  "qty": 1,
  "order_type": "LMT",
  "limit": 2.45,
  "account": "paper"
}

Your relay's docs override everything. OptionTrigger does not consume this format.

3. Options symbology checklist

FieldVerify
UnderlyingMatches IBKR symbol (SPY vs SPXW different products)
ExpiryYYYYMMDD vs relay format
StrikeNumeric, correct scale
RightC/P enum matches relay
Multiplier100 for standard US equity options
Trading classIndex vs ETF weeklies

4. Bracket / TP/SL in JSON

If the relay supports brackets, include:

  • Take-profit price or % on premium
  • Stop-loss price or % on premium
  • Time-in-force

Mismatch here is why many traders prefer premium-based chart TP/SL for discretionary trades.


IBKR session requirements

Before arming alerts:

  • TWS or IB Gateway running (unless relay hosts session differently)
  • API enabled — IBKR TWS Configuration
  • Port matches relay config (7496 common for OptionTrigger stack; relay may differ)
  • Options permissions active
  • Market data for contract you alert on

Paper staging procedure

StepAction
1Create alert on chart with paper relay profile
2Fire once manually (test button) — inspect raw POST in relay logs
3Confirm one order in IBKR paper TWS
4Break JSON on purpose — confirm relay rejects safely
5Run 20 sessions across open/close volatility

Full paper guide: Paper Trade Options on TradingView.


Duplicate order prevention

LayerTactic
Pinealert.freq_once_per_bar_close; avoid repainting signals without understanding them
ChartOne webhook per strategy instance
RelayIdempotency key = alert time + symbol + side
IBKRDisable duplicate client IDs if self-hosting API

Multi-leg alerts (caution)

If your alert tries to fire two or four legs:

OptionTrigger remains single-leg for chart execution.


When to skip webhooks entirely

Choose chart-native execution if:

  • Trades are discretionary per session
  • You want drawn TP/SL without maintaining JSON templates
  • You prefer local routing — OptionTrigger Desktop

Compare vendors: /compare/optiontrigger-vs-pickmytrade.


ArticleTopic
IBKR + TradingViewPermissions, data, paths
TradingView Webhook AutomationArchitecture
Trade Options on TradingViewHub
💡
Trading guides (2026):