There are two moments when a Pine Script lets people down. The first is before it goes live: it looks perfect on a finished chart, every arrow at a turn, and then on live bars the arrows arrive late, move, or vanish. The second is after it goes live: the TradingView alert runs for a few weeks, and one day you realise you have not heard from it in a while, with no way to tell whether the market was quiet or the alert quietly stopped. Both problems have the same root. You are looking at the script from the wrong point in time. This guide covers the two checks PineScripter gives you for those two moments: Replay and the look-ahead check before a script goes live, and the Alert Log after.
Short answer
Before a script goes live, step through it in PineScripter's Replay, which hides every bar after the current one and shows which triggers fired on that bar and how many times each has fired so far, then run the look-ahead check, which reruns the script on cut-down data to find output that depends on bars it should not have seen yet. After it goes live on TradingView, give it a webhook address from PineScripter's Alert Log: every alert it fires is recorded with its name, price and exact time, and the log notices when the alert has gone unusually silent compared with how often it normally fires.
Key facts
- Replay steps through a chart run one bar at a time, with play, pause, step forward and back, jumping to a bar or date, and a playback speed you choose.
- Everything after the current bar is hidden, and a readout shows which triggers fired on that bar and how many times each has fired so far.
- You can ask the AI about any bar while you step, and pick the first and last bar replay plays through.
- The look-ahead check reruns the script on cut-down data to find output that depends on bars it should not have seen yet.
- The Alert Log gives each script a unique webhook address and records every alert with its name, price and exact time.
- It notices when an alert has gone unusually silent, to help tell "has not fired lately" apart from "may have expired or broken".
- Live alerts you can connect at once: Pro 10, Ultra 100, Power unlimited, and the free trial 2. TradingView webhooks need two-factor authentication on the TradingView account.
| Question | When | Which check answers it |
|---|---|---|
| When would this trigger really have appeared? | Before going live | Replay, bar by bar |
| Does the script use bars it should not have seen? | Before going live | Look-ahead check |
| What did the triggers do on past bars? | Before going live | Indicator Analysis |
| What did the live alert fire, at what price and time? | After going live | Alert Log |
| Is the alert quiet, or has it stopped? | After going live | Alert Log silence notice |
Why a finished chart is the wrong place to judge a script
A Pine Script on a historical chart is evaluated with every bar already closed. That is fine for a script that only ever looks backwards, and misleading for the many that do not. A swing point is confirmed several bars after it prints, but some scripts draw it on the swing bar itself. A higher-timeframe value can be requested in a way that hands each bar the value of a period that had not finished yet. A shape can be plotted on a bar while it is forming and then be gone by the close. On a finished chart all of these look the same as a script that behaves: arrows at the turns, levels at the reactions.
The only way to see the difference is to look from the point in time the script was at. That means hiding the future, bar by bar, and watching what the script draws with only the bars it would really have had.
Replay: watch the script with the future hidden
Run the script on PineScripter's chart, then open Replay. It steps through the run one bar at a time. You can play and pause at the speed you choose, step forward and back, or jump straight to a bar or a date, and you can set the first and last bar replay plays through, so you can focus on one stretch of history. Everything after the current bar is hidden. A readout tells you which triggers fired on the bar you are on and how many times each has fired so far.
Watch the moments that matter. Stop on a bar where the finished chart shows a perfect arrow at a turn and see whether the arrow is there yet. If it only appears several bars later, that is the honest delay of the script's logic, and it is the delay you would live with. If it never appears until the turn is long over, the finished chart was flattering it. While you step, you can ask the AI about the bar you are on, for example why a trigger fired here and not on the bar before.
The look-ahead check: catch what the eye misses
Replay shows you what happened, but it relies on you noticing. The look-ahead check does it systematically. It runs the script again on cut-down data, ending at earlier bars, and compares what the script produced with what it produced on the full history. Output that changes depending on bars that came later is output that depended on bars the script should not have seen yet. That is the most common reason a script looks better on a finished chart than it did live, and the check points you at it instead of leaving you to spot it.
Before you lean on any numbers, Indicator Analysis can then measure what the triggers did on past bars: how they cluster, which sessions or hours they fall in, how price moved 1, 5, 10 and 20 bars after each, and whether the run is clean enough to trust. Running it after the look-ahead check means you are measuring triggers that could really have appeared when they did. All of it describes the past; none of it is a forecast.
Going live: what a TradingView alert can and cannot tell you
Once you paste the script into TradingView and create an alert on it, TradingView runs its own saved copy of the script on its servers. That has two consequences people often miss. Edits you make to the script afterwards do not reach the running alert until you create it again. And the alert can stop without much ceremony: TradingView alerts can expire, and TradingView stops an alert that fires too many times in a short period. In both cases, what you experience is the same: silence.
How the alert fires matters too. A condition checked on every tick can fire on a bar that is still forming and then no longer be true at the close, so the alert records something the chart will not show. Firing once per bar close avoids that, and also keeps a script on a low timeframe away from the burst of firings that can get an alert stopped.
The Alert Log: a record of every alert, and of silence
PineScripter's Alert Log gives each script a unique webhook address. Paste it into the webhook URL field of the TradingView alert, and every time the alert fires, the log records it with its name, price and exact time. PineScripter can write the alert() call into your script so that each alert carries its trigger name and price without you hand-writing the message, and it also reads messages written with TradingView's own placeholders. TradingView's webhook alerts require two-factor authentication on your TradingView account, and a TradingView plan that supports webhooks.
The part that answers the "has it stopped?" question is the silence notice. The log judges silence against the alert's own rhythm rather than a fixed number of hours, because an alert that normally fires every ten minutes has clearly gone quiet after six hours, while one that fires monthly has not. When an alert has gone unusually silent, the log says so, worded as a reason to go and check the alert on TradingView rather than a claim that it is broken, since PineScripter cannot see the alert's state on TradingView. You can connect up to 10 live alerts on Pro, 100 on Ultra, an unlimited number on Power, and 2 on the free trial.
A simple routine that uses both
Before going live: run the script on the chart, replay a few stretches you care about, run the look-ahead check, and fix anything it finds. Ask the AI to change the offending line and look at the Code Changes view to see exactly what moved. Then measure the triggers with Indicator Analysis, so you know roughly how often the script fires and when. After going live: create the TradingView alert to fire once per bar close, paste the Alert Log's webhook address into it, and let the log keep the record. When the silence notice appears, check the alert on TradingView. When you change the script, recreate the alert so TradingView runs the version you are looking at.
None of this tells you what to trade. It tells you whether the script you are relying on behaves the way you think, and whether it is still running. Those are the two questions a script owner should be able to answer at any time.
Frequently asked questions
How do I check if my Pine Script repaints?
Step through it with replay, with every bar after the current one hidden, and watch whether triggers appear on the bars the finished chart shows them on. Then run a look-ahead check, which reruns the script on cut-down data and flags output that depends on bars it should not have seen yet.
What is PineScripter's Alert Log?
A log of every alert a live TradingView script fires. Each script gets a unique webhook address; paste it into the alert's webhook URL field, and each alert is recorded with its name, price and exact time. It also notices when an alert has gone unusually silent.
Why did my TradingView alert stop firing?
Common reasons are that the condition simply has not been met, that the alert expired, or that TradingView stopped it for firing too often in a short time. Editing the script also does not update a running alert. PineScripter's Alert Log flags unusual silence so you know when to check.
Do I need a paid TradingView plan for webhook alerts?
You need a TradingView plan that supports webhooks, and TradingView requires two-factor authentication on the account to use webhook alerts.
How many alerts can I log?
Up to 10 live alerts at once on Pro, 100 on Ultra, an unlimited number on Power, and 2 on the free trial.
The practical takeaway
A script needs checking twice. Before it goes live, look at it from the point in time it would really have been at: replay with the future hidden, and a look-ahead check for anything that peeks. After it goes live, keep a record of what it fired and notice when it goes quiet. PineScripter does both on the same script, so the version you checked is the version you are watching.
Replay, the look-ahead check and the Alert Log all work on the same scripts in PineScripter. Replay a script before it goes live, then give its TradingView alert a webhook address and let the log keep the record.
Sources
- TradingView: how to configure webhook alerts
- Pine Script v6 reference: alert()
- Pine Script v6 reference: barstate.isconfirmed
Related reading: what PineScripter is, the kinds of repainting, lookahead explained, Pine Script alerts guide, bar replay.
Disclaimer: PineScripter is a coding tool for Pine Script development. It does not provide financial advice and does not guarantee trading profits. Always backtest strategies thoroughly and understand the risks before live trading.