Backtesting Concepts

Multi-Timeframe Analysis

Reference a higher timeframe inside a single condition -- confirm a trade against the bigger-trend picture without leaking future data.

Multi-Timeframe Analysis

Most traders do not look at a single chart in isolation. They check the bigger picture first -- the daily trend -- and then drop down to a faster chart to time the actual entry. Multi-timeframe analysis brings that habit into a single strategy: one condition can read a higher timeframe than the chart you are trading on.

A concrete example: trade on the 1-hour chart, but only go long when the 4-hour trend is also up. The 1-hour candle decides when you can act; the 4-hour moving average decides whether the move agrees with the larger trend. Each side of a condition carries its own timeframe, so you can mix them freely inside one rule.

There is no separate multi-timeframe mode
A strategy becomes multi-timeframe the moment any condition references a timeframe higher than the chart. Leave every condition on "match strategy" and it behaves exactly like an ordinary single-timeframe backtest. Set one condition to a higher timeframe and that condition -- and only that condition -- starts reading the higher timeframe.

Why It Matters

A signal that looks great on a fast chart can be fighting the larger trend. A 1-hour oversold bounce means one thing when the daily trend is rising and the opposite when the daily trend is falling. A higher-timeframe condition lets you filter out the trades that disagree with the bigger picture instead of taking every fast-chart signal blindly.

This is the same idea as combining indicators for confirmation, but along the time axis instead of the indicator axis. Rather than stacking two indicators on the same chart, you ask whether a slower chart and a faster chart agree. When they do, the setup has confluence; when they do not, you stand aside.

How It Works

The backtest still runs one candle at a time. The candle interval it steps through -- the base timeframe -- is the fastest timeframe any condition uses. If your fastest condition is 1-hour, the strategy evaluates at every 1-hour close, exactly as a normal 1-hour backtest would. Adding a 4-hour or daily condition does not change when the strategy can act; it only adds a higher-timeframe value to check at each of those 1-hour closes.

The forming higher-timeframe candle

Here is the part that makes multi-timeframe analysis trustworthy. At a given 1-hour close, the current 4-hour candle has usually not finished forming yet. The honest value to use is the 4-hour candle built from only the 1-hour candles that have closed so far -- never its eventual final close, which a live trader would not yet know.

==4 closed 1H candlescompleted 4H2 closed so farpartial 4HThe 4-hour candle has closed.The 4-hour candle is still forming.The strategy only ever sees the candles that have already closed -- never the future of theforming 4-hour candle.
A higher-timeframe candle is rebuilt from the lower-timeframe candles that have closed so far -- so a forming 4-hour candle reflects only the past, not its own final close.

So the higher-timeframe value updates at every base-candle close as the forming candle fills in. The 4-hour candles that have already closed are fixed; the one still in progress grows one 1-hour candle at a time. At the exact moment the 4-hour candle closes, its partial value equals its final value -- they have to, because by then every 1-hour candle inside it has closed.

This is what prevents look-ahead bias
A naive multi-timeframe backtest reads the completed 4-hour candle at the moment a 1-hour signal fires -- but that candle would not have finished for up to another three hours. That is look-ahead bias: the strategy is reacting to information from the future, which makes its results look better than anything achievable live. Building the higher-timeframe value only from closed candles is what keeps a multi-timeframe backtest honest.

Higher timeframes only

A condition can reference a timeframe equal to or higher than the chart, never lower. You can read a 4-hour or daily value on a 1-hour chart, but you cannot read a 1-minute value on a 1-hour chart. The reason is mechanical: a higher-timeframe candle is built by grouping the chart's candles together, and you cannot manufacture finer candles that the chart does not contain. Setting a condition to the chart timeframe is simply "match strategy" -- no higher timeframe involved. Multi-timeframe analysis is available for instruments that store more than one candle interval; the condition builder only offers the timeframes you can actually use.

Daily conditions on a stock chart

On stocks, a condition set to the daily timeframe builds its daily candle from the regular-hours candles the strategy is running on -- 09:30 to 16:00 Eastern. The daily chart you can open for the same symbol is not built that way. That candle comes from the exchange's own daily record, which includes the opening and closing auctions and trades reported away from the primary exchange.

So the two disagree, and not rarely. Measured on AAPL across 43 sessions, the regular-hours daily close matched the daily chart's close on 3 of them, and on roughly a quarter to a third of sessions the daily chart's high or low sat outside the regular-hours range entirely. The gap is largest on days with a heavy closing auction.

Which candle your condition is reading
A daily condition inside an intraday stock strategy reads the regular-hours version. That is what lets it update as the day fills in, rather than only after the session ends. If you want the exchange's daily candle instead, run the strategy on the daily timeframe, where that is the candle the backtest uses.

Common Mistakes

Expecting the higher-timeframe value to jump only at its own close
The higher-timeframe value refreshes at every base-candle close as the forming candle grows -- it does not sit frozen until the 4-hour or daily candle closes. That is the intended real-time behavior, and it is what a live trader watching a forming candle would see.
Treating candlestick patterns as partial
A candlestick pattern is a property of a finished candle -- a "hammer" on a half-formed 4-hour candle is not a hammer yet. For patterns and a small set of indicators that flicker on an unfinished candle, the strategy waits for the higher-timeframe candle to close and uses its last completed value instead of a forming one.
Adding timeframes without watching for overfitting
Every extra timeframe and indicator is another knob you can turn until the strategy fits the past. More confirmation looks reassuring, but it also makes it easier to curve-fit. Validate a multi-timeframe strategy on data it was not designed on with walk-forward analysis before trusting it.

Where to Go Next

Timeframes & Data -- how a single candle interval shapes signal frequency and how much history you need.

Entry & Exit Conditions -- the crossovers, thresholds, and AND/OR logic that multi-timeframe conditions build on.

How the Simulation Works -- the candle-by-candle loop that evaluates every condition, single- or multi-timeframe.

Walk-Forward Analysis -- the validation method that catches a multi-timeframe strategy that only fits the past.