Concept

Repaint-safe Engineering

Repaint-safe Engineering, also known as bar-close vs intrabar evaluation, live/backtest parity, is a Meta & Composition concept. The Library holds 3 implementations, each one a working definition you can pull into Quant.

Top Repaint-safe Engineering indicators

3 total

What is Repaint-safe Engineering?

Repaint-safe engineering is the discipline of building indicators and signals so that what history shows is what live trading actually displayed. An indicator "repaints" when its past output changes after the fact: a signal that appeared intrabar vanishes by the close, a multi-timeframe value silently uses the still-forming higher-timeframe bar, or a structure such as a pivot is drawn bars after the price it marks. On a historical chart all of these look clean and prescient, because history only stores the final version. Repaint-safety means engineering, and testing, for live/backtest parity.

The failure modes have distinct fixes. Intrabar evaluation is solved by confirming conditions on closed bars only. Higher-timeframe references are solved by reading only completed higher-timeframe bars, accepting one bar of staleness instead of a value that mutates until the period ends. Retroactive structures (swing pivots, Williams fractals, zigzag legs) are legitimate but must be acted on, and backtested, only after their confirmation delay has elapsed. The common thread is honest accounting: waiting for confirmation costs entry lateness, and repaint-safe design makes that cost explicit rather than hiding it in a backtest that could never have been traded.

How traders use it

  • As alert discipline: conditions are evaluated once per closed bar and fire on bar close, so what reaches alerts and webhooks matches what the chart will still show tomorrow.
  • As multi-timeframe hygiene: any higher-timeframe trend filter or level reference reads the last completed higher-timeframe bar, never the forming one, keeping live values identical to their historical reconstruction.
  • As backtest honesty: signals derived from lagged structures are shifted by their confirmation delay before performance is measured, and fills are simulated at prices available after the signal existed, not at the bar that produced it in hindsight.
  • As the trigger stage of a pipeline: within a filter-setup-trigger-exit architecture, the trigger is where repaint-safety is enforced, because it is the moment orders and alerts leave the chart.

Repaint-safe Engineering vs related disciplines

Signal Hygiene: Hygiene covers the broader cleanliness of a signal stream: deduplication, debouncing, resolving conflicting signals. Repaint-safety is the temporal slice of it, guaranteeing that a signal, once emitted, is permanent and would have existed live.

Zigzag Structure: A zigzag redraws its most recent leg by design; that is deliberate retrospection, not a bug. The repaint problem arises when such structures are backtested or alerted as if their pivots were known in real time. Repaint-safe use keeps the tool and adds the confirmation delay.

In-sample / Out-of-sample Split: The in-sample/out-of-sample split guards against overfitting parameters to history. Repaint-safety guards against evaluating history with information that did not yet exist. A strategy can pass out-of-sample and still be untradeable if its signals repaint; the two validations are independent.

Related concepts · Signal engineering

Concept family

Meta & Composition

28 concepts mapped · 23 in the Library

Repaint-safe Engineering FAQ

What does it mean when an indicator repaints?

Its historical output differs from what it displayed in real time. Typical forms: intrabar signals that disappear once the bar closes, values recalculated as new data arrives, higher-timeframe references that backfill after the period completes, and pivots plotted bars into the past. Repainting is not always deceptive, but repainting logic can make historical charts look better than live trading could have been.

Is all repainting bad?

No. Some retrospection is inherent and honest: a swing pivot cannot be known until later bars confirm it, and tools that revise a developing structure are useful precisely because they update. The problem is unacknowledged repainting: backtesting or advertising those signals as if they had been available at the bar where history now draws them. The fix is disclosure plus confirmation delays, not abandoning the tools.

How do you test whether an indicator repaints?

Log it live: record alerts or bar-by-bar screenshots as bars close, then compare against the same chart reloaded later; any discrepancy is repainting. Also inspect the logic itself: does anything evaluate before the bar closes, reference a forming higher-timeframe bar, or draw at an offset into the past? Bar-replay tools help, but a patient live log over real sessions is the decisive evidence.

Build Repaint-safe Engineering your way.

Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.