Which question does each of Replay, the Strategy Tester and Paper Trading answer, and which can’t it answer?
This post follows one BTC H1 event through three columns: a Replay screenshot, the trade in the Strategy Tester, and the fill on a paper account. Then it logs the times of signal, alert and receipt during a forward run. The easy mistake: passing one check isn’t passing them all, and a few profitable paper trades don’t check the historical data.
Terms used below:
- Bar Replay: TradingView’s mode that hides the candles after a chosen point and reveals them one at a time.
- Strategy Tester: simulates a strategy’s trades on history with the script’s and the platform’s fill assumptions.
- Paper Trading: a simulated account for practising placing and managing orders.
- Forward/demo: following the system as new data arrives, in a simulated environment.
- Latency: the delay between an event and the moment you or a program receive it.
Three layers of checking; none replaces another
Lock one version of the rules and code first. Run the Tester on the chosen period and check the costs and the data. Use Replay to compare a few signal candles without seeing the future. Then run demo/forward and log missing alerts, delays and different fills as well. Menu, plan and permission names can change; if a feature isn’t there, look it up in the platform’s help rather than faking a report.
| Gate | Check | If not |
|---|---|---|
| 1 | Strategy Tester: costs and data checked? | Check again; when comparing setups, keep the feed, timeframe, period and costs fixed |
| 2 | Replay: do the signals hold with the future hidden? | Stop, read the log, check one case by hand |
| 3 | Demo/forward: can you explain late alerts and different fills? | Don’t move the rule to a demo EA yet |
| Passed | Evidence at all three layers; the demo sample is still small |
A system that passes one step hasn’t passed every step: each tool checks a different layer.
Beyond TradingView, MT5 and backtesting.py (the backtest post) there’s LEAN, QuantConnect’s open-source engine (checked 2026-11-23). The engine is Apache-2.0; building it yourself from the QuantConnect/Lean repository (Windows, macOS, Linux; it needs Microsoft’s .NET SDK) costs nothing. The LEAN CLI, the command-line tool most users are pointed to, needs an account in a paid QuantConnect organisation. A beginner doesn’t need LEAN for this post.
An error that only shows up forward
The backtest passes, but alerts arrive late and the current candle changes its signal. What to do:
- Log three timestamps for every event: signal, alert, receipt.
- Check whether the alert is set to “once per bar” or “once per bar close”.
- Check for signals on a forming candle and for data from other timeframes.
- Don’t move the rule to an EA on the demo until you can explain the difference. Automated demo orders only come from an EA (a program running inside MT5) working on MT5’s own candles, never from a TradingView alert.
| Timestamp | When | What to check |
|---|---|---|
| Signal | The candle that creates it | Was that candle still forming or closed? Any data from another timeframe? |
| Alert | “Once per bar” or “once per bar close” | Write down which setting you chose |
| Receive | When the message reaches you | Compare with the signal time to see late alerts |
Comparing the three shows whether an alert came late or the signal changed on a forming candle. An alert only carries news; until you can explain the differences, don’t build a demo EA.
A small script that reads the log, src/alert_delays.py:
# src/alert_delays.py: read the forward log of signal, alert and receive times and show where the delay comes from.
# Reads logs/alerts.csv only. Calls no broker, sends no orders.
# Run: .venv\Scripts\python src\alert_delays.py --max-seconds 60
import argparse
import csv
from datetime import datetime
TF = "%Y-%m-%dT%H:%M:%SZ"
ap = argparse.ArgumentParser()
ap.add_argument("--file", default="logs/alerts.csv")
ap.add_argument("--max-seconds", type=float, default=60, help="flag events whose alert-to-receive or close-to-alert gap is longer")
a = ap.parse_args()
with open(a.file, encoding="utf-8-sig") as f:
rows = list(csv.DictReader(f))
print("event mode close->alert alert->receive flag")
late = 0
for r in rows:
close = datetime.strptime(r["bar_close_utc"], TF)
alert = datetime.strptime(r["alert_utc"], TF)
got = datetime.strptime(r["received_utc"], TF)
s1, s2 = (alert - close).total_seconds(), (got - alert).total_seconds()
flag = []
if s1 < 0:
flag.append("ALERT BEFORE CLOSE: fired on a forming candle")
if max(s1, s2) > a.max_seconds:
flag.append("LATE")
if r.get("signal_on_history", "").strip().lower() == "no":
flag.append("GONE ON HISTORY: repaint")
late += bool(flag)
print(f"{r['event_id']:<21} {r['alert_mode']:<15} {s1:>11.0f}s {s2:>13.0f}s {'; '.join(flag) or 'ok'}")
print(f"{len(rows)} events, {late} flagged. Explain every flagged event before moving the rule to a demo EA.")A sample logs/alerts.csv (made-up events; signal_on_history is whether
the marker is still there after you reload the chart):
event_id,alert_mode,bar_close_utc,alert_utc,received_utc,signal_on_history
btc-h1-20261116-0900,once per bar close,2026-11-16T09:00:00Z,2026-11-16T09:00:04Z,2026-11-16T09:00:09Z,yes
btc-h1-20261116-1400,once per bar,2026-11-16T14:00:00Z,2026-11-16T13:37:12Z,2026-11-16T13:37:15Z,no
btc-h1-20261117-0300,once per bar close,2026-11-17T03:00:00Z,2026-11-17T03:00:05Z,2026-11-17T03:03:41Z,yesWhat it prints:
event mode close->alert alert->receive flag
btc-h1-20261116-0900 once per bar close 4s 5s ok
btc-h1-20261116-1400 once per bar -1368s 3s ALERT BEFORE CLOSE: fired on a forming candle; GONE ON HISTORY: repaint
btc-h1-20261117-0300 once per bar close 5s 216s LATE
3 events, 2 flagged. Explain every flagged event before moving the rule to a demo EA.The second event fired 23 minutes before the candle closed, with “once per bar”, and the marker is gone after a reload: a signal on a forming candle that repainted. The third arrived 216 seconds after the alert: the delay is in the delivery, not in the rule.
Worked example: three test environments, three different questions
| Replay | Strategy Tester | Paper Trading |
|---|---|---|
| When does the signal appear? | Which trades does the script’s logic create? | How does placing simulated orders work? |
| Practise deciding without knowing what comes next | Simulation on history | A simulated fill environment |
| Save screenshots before and after the close | Read the entry and exit prices and the reasons | Save the ticket and the fill price |
Replay is for watching signals appear and practising decisions without knowing what follows. The Strategy Tester uses the script’s and the platform’s simulation logic to create trades; Paper Trading uses a simulated fill environment to practise handling orders. They don’t share the same fill mechanism, data or costs.
Pick one BTC H1 event. In Replay, save screenshots before and after the close. In the strategy, find the trade tied to that event and read its entry and exit prices and reasons. On paper or demo, save the ticket and the fill price if you try it. Put them in three columns rather than demanding three identical prices; the differences have to be explainable.
If the strategy counts a limit order as filled but the demo account didn’t fill it, check the order of prices, the spread, latency and the order type before blaming the method. The point here is to compare mechanisms and catch wrong assumptions, not to pick the environment with the nicest P&L.
Try it: a guided Replay, Tester and Paper Trading check
Guide me, as a beginner, through checking a Pine strategy in TradingView. Use only the Paper Trading account and the Strategy Tester. Write each click and menu for the current interface, the fields to fill in (symbol/provider, timeframe, date range, simulated capital, commission, slippage), how to open the Strategy Tester, open the list of trades, and save the settings and report. Explain separately how Bar Replay differs from Paper Trading and from alerts. Don't ask me to press a real Buy or Sell. End with a checklist so I know I can reproduce the run.Never paste passwords, API keys or tokens into a prompt, and check whatever the AI returns on the demo account before relying on it.
The order to work in:
- Write down the symbol/provider, time zone, timeframe, start and end dates and chart type.
- Set simulated costs, spread or slippage; save a screenshot of the settings with the report.
- Practise with Bar Replay and the paper account; never send a real order for this exercise.
Key takeaways
- Replay practises decisions without seeing later candles; the Tester checks the script’s logic on history; Paper practises handling simulated orders.
- Late alerts and signals that change on a forming candle: log signal, alert and receive times; until you can explain them, no demo EA; an alert only carries news.
- A limit the Tester counts as filled but the demo didn’t fill: check price order, spread, latency and order type before blaming the method.
Comments