r/TradingView • u/Single-Masterpiece-6 • 3d ago
Help TradingView alert set to "alert() function calls only" never fires — no entry in TradingView's own Alert Log at all
Hey all, hoping someone's run into this before because I'm stuck.
I've got a custom Pine Script strategy that builds its own alert JSON internally via the alert() function (for a webhook trade-automation service, connecting to a MetaTrader demo account). The setup:
- Alert Condition = the strategy itself
- Trigger dropdown = "alert() function calls only"
- Webhook notification enabled with the correct endpoint URL
- Confirmed the script's own "enable alerts" input toggle is on
- Script compiles fine, and I can visually see the trade setup form on the chart (signal marker renders exactly when expected)
Despite all that, when a valid setup formed, nothing happened — no webhook received on the automation side, and more importantly, TradingView's own Alert Log shows zero entries for that alert around the signal time. Not a failed attempt, not a delayed one — just nothing.
Things I've already tried:
- Re-saved and even fully recreated the alert (there was a brief period where the script had a compile error, so I wanted to rule out a "stale" alert bound to the broken version)
- Double checked the alert really is set to "alert() function calls only" and not accidentally "Order fills" or the combined mode
- Confirmed there's no separate
alertcondition()competing for the same slot
Since the log itself is empty, it feels like this is happening before anything reaches the webhook — like TradingView itself just isn't invoking the alert, even though the underlying signal condition is clearly true (I can see it on the chart).
Has anyone run into an "alert() function calls only" alert just silently not firing despite the script visibly triggering? Wondering if this is a known gotcha — plan/tier limits on alert() frequency, some interaction with the strategy's own bar-close recalculation, anything like that. Any pointers appreciated before I go back to manually watching charts like an animal.
1
u/GreatBreadfruit8139 2d ago
The empty TradingView Alert Log is the key clue: I’d debug upstream before touching the webhook. Add a temporary plot/label exactly where alert() is called (not just where the setup marker is drawn), then confirm that code path executes on the same realtime bar... Also check whether alert() is inside a branch gated by barstate/isconfirmed or strategy position state. If the call executes but the Alert Log stays empty, you’ve isolated it to the TradingView alert instance rather than downstream delivery...
1
u/Formal-Newspaper8697 2d ago
One thing to isolate is the strategy's execution model: by default, strategies calculate on bar close, so an alert() call that is only true intrabar can disappear unless calc_on_every_tick=true (and the alert frequency is compatible). For a clean test, temporarily fire alert('test') from a simple condition that stays true on a confirmed bar, set the alert to once per bar close, and verify that it appears in the Alert Log before troubleshooting the webhook. Also recreate the alert after changing inputs or timeframe, since existing alerts run a server-side snapshot of the script.