Alerts & Webhooks
Every framework event can fire as a TradingView alert carrying a clean, flat JSON payload, ready for webhooks, trading bots, journals, and downstream review systems.
How alerting works
IIF uses TradingView's alert() dispatch model: you toggle the events you care about inside the indicator settings (10 Alerts - Any Events), then create one alert on the indicator with the condition Any alert() function call. Every enabled event flows through that single alert, each with its own JSON body.
- All events dispatch once per bar close, consistent with the framework's confirmed-bar, no-repaint design.
- Bullish and bearish variants toggle independently, so a webhook can subscribe to exactly one side.
- The Confluence Engine fires through the same channel, with your custom rule name as the event.
Event catalog
| Setting | Default | What it does |
|---|---|---|
| Bull / Bear OB Created | - | A new OrderBlock qualified and is now tracked. |
| Bull / Bear OB Tapped | - | Price entered an active OrderBlock for the first time. |
| Bull / Bear OB Mitigated | - | Every internal gap filled and price closed outside. The block fully resolved. |
| Bull / Bear Exhaustion | - | The Block Exhaustion signal fired (heavily filled block + CVMI extreme). |
| Bull / Bear Sweep | - | The Block Sweep signal fired (edge swept, zone reclaimed, closes confirmed). |
| Bull / Bear Failure | - | A block’s structural break level was breached. Bull = bearish OB broken upward; Bear = bullish OB broken downward. |
| Bull / Bear Squeeze | - | A Squeeze Candle printed: a single-bar momentum extreme out of compression. |
| Shift Detected / Broken | - | A new Structural Shift level appeared, or an existing one was broken. |
| Trend Change | - | The structural trend flipped direction. |
Event names arrive in the payload exactly as listed (e.g. "Bullish Sweep", "Shift Broken"), so downstream routing is a simple string match.
Setting up an alert
- 1Toggle the events you want
In the indicator settings, open
10 Alerts - Any Eventsand enable the specific bull/bear events (or configure a Confluence rule instead). - 2Create one TradingView alert
Right-click the chart →
Add alert. Condition: the IIF indicator →Any alert() function call. Leave the message field as-is; the script supplies the JSON body. - 3Point it at your endpoint
For automation, enable the
Webhook URLnotification and paste your endpoint. For discretionary use, app/popup/email notifications carry the same JSON text.
Because dispatch is centralized, you rarely need more than one TradingView alert per chart, which is useful on plans with low alert limits. Route by the event field on your server instead.
The JSON payload
Payloads are intentionally flat, with no nesting and no arrays, so they parse trivially in any webhook receiver, spreadsheet importer, or no-code tool:
{
"event": "Bullish Exhaustion",
"ticker": "BTCUSD",
"exchange": "COINBASE",
"tf": "720",
"htf": "1W",
"osc": 18.5,
"time": 1779246306000
}| Setting | Default | What it does |
|---|---|---|
| event | always | The event name, or your Confluence rule’s Alert Name. |
| ticker / exchange | On | Symbol and exchange prefix, from the “Symbol & Timeframe” toggle. |
| tf / htf | On | Chart timeframe and the SOMM detection HTF (TradingView notation: minutes, or D/W/M). |
| osc | On | CVMI at dispatch: the normalized 0-100 reading when normalization is on, the raw index otherwise. |
| time | On | Unix millisecond timestamp of dispatch. |
Each optional field group can be excluded from the payload via its toggle if your receiver wants a minimal body.
Automation patterns
- Bot gating: rather than executing on raw signals, many users feed
oscinto their bot as a regime filter: only take longs delivered withoscbelow 30, for example. - Journaling: pipe payloads into a sheet or database; the flat schema means every field becomes a column. Over time you get a personal hit-rate dataset per event type, per symbol, per session.
- Multi-timeframe dashboards: run IIF on several charts with one webhook endpoint; the
tf/htffields keep streams separable. - Confluence-first automation: the cleanest pattern is to encode the entire entry condition in the Confluence Engine so the webhook only ever receives decision-grade events.
Alert payloads are analytical events, not trade instructions. Anything you build downstream (sizing, risk, execution) is outside the indicator's scope. Test against paper endpoints first.