NRUNO Trading Automation Wiki

Pine Script & TradingView Alerts

Alert types, realtime behavior, repainting, strategy execution and alert lifecycle.

010What is the difference between alert(), alertcondition() and strategy alerts?

alertcondition exposes indicator conditions; alert supports dynamic messages; strategies also expose order-fill events that are useful for automation.

011Why is my TradingView alert not triggering?

Check the server-side alert instance, not only the current chart. Alerts use a saved snapshot; repainting, expiration, runtime errors and frequency limits can also explain…

026Why is my old TradingView alert still running after I changed the Pine Script?

TradingView runs a saved server-side snapshot of the script, inputs, symbol and timeframe that existed when the alert was created. Editing the chart later does not update that…

027Once Per Bar vs Once Per Bar Close: which should I use for automation?

Once Per Bar can react during a realtime bar; Once Per Bar Close waits for the closing update. Use confirmed-bar behavior when the strategy requires confirmation, and intrabar…

028What is repainting and why can it change automated signals?

Repainting means past or historical-looking results can differ from what existed in realtime. For automation, ask whether the exact data that triggered the live alert can later…

029What does calc_on_every_tick do to a TradingView strategy?

calconeverytick=true makes a strategy recalculate on each new realtime update rather than only at bar close. Historical bars do not contain the same full tick stream, so live and…

030Order-fill alerts vs alert(): which is better for automated execution?

Order-fill alerts fire when TradingView's broker emulator fills a strategy order and are often a closer match for automating strategy fills. alert is more flexible for arbitrary…

031What happens when a TradingView alert triggers more than 15 times in three minutes?

TradingView automatically stops a regular/script alert if it triggers more than 15 times within three minutes. High-frequency logic must control alert frequency instead of…

051How do I prevent TradingView alert flooding without missing valid trades?

Use explicit state changes, cooldowns and appropriate alert frequency rather than suppressing messages blindly. TradingView can stop a script alert if it fires more than 15 times…

052How do I safely replace an active TradingView alert after changing Pine Script?

Create and verify the replacement alert before retiring the old one, but prevent both from being execution-active at the same time. TradingView alerts run saved snapshots, so…

053Can old and new TradingView alerts run at the same time and duplicate trades?

Yes. A newly created alert does not automatically remove the previous server-side alert. If both target the same execution route, both can independently fire and create duplicate…

054How should I version Pine strategies and webhook alerts?

Give strategy releases, alert instances and webhook schemas explicit versions. Versioning lets support and audit logs prove which logic produced a live signal and prevents silent…

055Can a repainting TradingView strategy still be automated safely?

Sometimes, but only if the realtime behavior is intentional, documented and tested. A repainting script can be valid for live use while still making historical charts or…

056How can request.security() repaint higher-timeframe signals?

request.security can return unconfirmed higher-timeframe values on realtime bars that later differ after confirmation. TradingView documents a non-repainting HTF pattern using a…

057What does barstate.isconfirmed do for TradingView alerts?

barstate.isconfirmed is true on historical bars and on the closing update of a realtime bar. It can be used to delay a chart-timeframe signal until bar confirmation, but…

058What is calc_on_order_fills and when should I use it?

calconorderfills lets a strategy recalculate after an order fill, enabling logic that reacts immediately to simulated position changes. It can also produce unrealistic historical…

059What is process_orders_on_close and how does it affect automation?

processordersonclose allows TradingView's broker emulator to fill a strategy order on the signal bar's closing tick instead of the next available bar. TradingView warns that…

077Why did my TradingView alert fire at a different price than the chart marker?

Chart markers, alert evaluation and live broker execution can reference different moments and prices. Realtime updates, strategy fill timing, bid/ask spread, latency and slippage…

078Why does my TradingView strategy behave differently after the chart reloads?

After reload, realtime bars become historical bars and lose their original intrabar update sequence. Tick-sensitive, repainting or realtime-only logic can therefore display…

079What is varip and why can it make historical backtests misleading?

varip persists values across executions within the same realtime bar, escaping Pine's normal rollback. Historical bars cannot reproduce the same intrabar execution history, so…

080How does Bar Magnifier change TradingView strategy fills?

Bar Magnifier uses lower-timeframe data to improve the broker emulator's historical fill assumptions. It can resolve ambiguous intrabar order sequencing, but it still does not…

081What is pyramiding and how can it accidentally create multiple positions?

Pyramiding controls successive strategy.entry additions in the same direction. If each resulting alert becomes a fresh live entry, intentional or accidental pyramiding can…