How a webhook trade travels
- A Pine Script condition or a drawing alert fires on TradingView’s servers.
- TradingView sends an HTTP POST with your alert message to the webhook URL.
- A relay service authenticates and parses the message.
- The relay maps it to an order and submits it to your broker’s API.
- The broker fills, rejects or leaves the order working.
Each step can fail independently, and none of them sees the others. That is the central design fact of webhook automation.
A typical alert message
The message is whatever you type into the alert. Relays define their own fields; a common shape looks like this:
{
"ticker": "{{ticker}}",
"action": "buy",
"price": "{{close}}",
"time": "{{timenow}}",
"option": { "right": "call", "expiry": "nearest", "strike": "atm" }
}TradingView fills the {{…}} placeholders. The option fields are interpreted by the relay, not TradingView, which knows only the chart symbol.
When webhooks make sense
- You have a tested, rule-based strategy and want entries without watching the screen.
- You trade products the relay and broker support well, often futures or shares.
- You can monitor and reconcile orders, and accept a cloud service holding broker access.
The TradingView side
- Webhook alerts need a paid TradingView plan and two-factor authentication on the account.
- Alert counts and other limits depend on the plan; check TradingView’s current plan page.
- Use bar-close alerts for strategy signals to avoid acting on a bar that later changes.
- An alert created on a script keeps that script version; recreate it after editing the script.
Relay services
Relays differ in brokers, asset classes, how they choose option contracts and where they run. Compare them on the failure modes below, not only the feature list. Overviews: TradersPost alternatives and PickMyTrade alternatives.
For Interactive Brokers, a relay either uses IBKR’s web API or reaches a TWS or IB Gateway session that you keep running. Either way, IBKR permissions and market data must be in place; see the IBKR TWS options guide.
Failure modes to test before going live
| Failure | What happens | What to check |
|---|---|---|
| Duplicate alert | Two orders for one signal. | Idempotency in the relay; alert frequency settings. |
| Delayed delivery | Entry at a much worse option price. | Limit orders, a maximum signal age. |
| Missed alert | Entry without an exit, or no entry. | Exit orders held at the broker. |
| Wrong contract | Strike or expiry not what you intended. | How the relay resolves “ATM” or “nearest”. |
| Broker rejection | Nothing traded, often silently. | Notifications and a daily reconciliation. |
| Position mismatch | Relay and broker disagree on what you hold. | Compare with the broker after every session. |
Webhooks or chart-native?
If you trade intraday options from levels you draw yourself, a webhook pipeline adds steps without adding judgment. A chart-native workflow keeps the entry as your decision and automates the exits.
OptionTrigger is not a webhook tool. You draw targets and stops on the TradingView stock chart, choose a call or put and click Buy; a local engine on your Mac connected to IBKR sells the filled position when the stock reaches your levels. It does not accept alerts or webhooks and does not enter automatically. See options trading automation for the full comparison.
Paper first, then small
Run any webhook setup against a paper account long enough to see duplicates, rejections and an outage. Then go live at the smallest size and reconcile daily. Automation that cannot be audited is not ready for real money.
Frequently asked questions
What is a TradingView webhook?
An alert option that sends your alert message to a URL as an HTTP POST when the alert fires. Relay services listen at that URL and turn the message into broker orders.
Do webhooks work for options on IBKR?
Through a relay that supports IBKR options, yes. The relay has to pick the option contract, and your IBKR account needs options permissions and market data.
Is OptionTrigger a webhook tool?
No. OptionTrigger is chart-native: you plan on the stock chart, enter explicitly, and a local engine manages exits from the stock price. It does not accept TradingView alerts or webhooks.
What are the biggest webhook risks?
Duplicate or delayed alerts, missed exits, the relay choosing a different contract than intended, and silent broker rejections. Test each on a paper account.