Articles ·
Backtests now trade inside every bar on the exchange's finer candles
A candle does not say whether its high or its low came first. Until now, a Metrand backtest walked a bar that reached a position's stop and its target both ways and kept the way worse for the account. That is a safe bound, never a flattering one, but it is an assumption. Backtests now read what happened instead: the exchange's own finer candles under the bars, the minutes under an hour where they fit.
The strategy still decides on its own bars, at their close. Inside each bar, its orders, stops, targets and liquidation trade on the finer candles, in the order the market made them.
Which finer candles
The finest candles of the same market and exchange that divide the bars, as many as fit in 50,000 for one market:
| Bars | 1m up to | 3m up to | 5m up to | 15m up to | 30m up to | 1h up to |
|---|---|---|---|---|---|---|
| 15m | 34 days | 104 days | 173 days | — | — | — |
| 1h | 34 days | 104 days | 173 days | 520 days | 2.8 years | — |
| 4h, 1d | 34 days | 104 days | 173 days | 520 days | 2.8 years | 5.7 years |
Longer windows of 4-hour and daily bars go on to 2-hour and 4-hour candles. A basket or a test across periods shares 100,000 between its markets or periods, so 20 markets get 5,000 each. The result says which candles it used, under the trades: "Inside every bar, orders, stops, take-profits and liquidation traded on the 1m candles under it".
What it changed on real data
We replayed one strategy on Binance USDⓈ-M futures, BTCUSDT, ETHUSDT and SOLUSDT, July to September 2025, on hourly bars: long while EMA 5 is above EMA 20, short while below, 1,000 USDT a trade on a 10,000 USDT account, 5 bps fees and 2 bps slippage. Each run three ways: every hour walked the worse way, on the 3-minute candles inside it (what a quarter of hourly bars gets now), and on the minutes.
- Tight brackets were understated. With a 0.5% stop and a 0.8% target on hourly bars, 144 of ETH's and SOL's 2,636 trades closed on hours that reached both levels. The minutes showed the target first in 53 of them: ETH's result was 272 USDT better than the worse way said, SOL's 416, and SOL's deepest drawdown 17.3% instead of 21.4%.
- Wide brackets were already right. With a 2% stop and a 3% target almost no hour reaches both, and the two agree to the dollar.
- Over the nine runs (three markets, three bracket widths), the worse way decided 158 trades; in 60 of them, 38%, the minutes reached the target first.
- Three-minute candles were enough. In all 18 runs, these nine and the momentum, mean-reversion and volatility templates on the same markets, they gave the result the minutes gave, to within half a cent.
The worse way was never wrong in the direction that matters: it never showed a strategy better than it was. Now it no longer shows one worse either, where the exchange's candles can say.
When the finer candles are missing
A bar the exchange has no finer candles for, or whose finer candles do not reach its own high and low, is walked both ways as before and counted. Past one such bar in twenty, the finer candles are not used at all. If the exchange does not answer in time, the backtest still runs on its bars. Either way the result says so and why.
What is still a limit
A one-minute candle has an order too: two of ETH's trades in the quarter met both levels inside a single minute and are still marked "either way". And no candle carries the order book, so a large market order still fills at its touch plus the slippage you set.
In the API
The engine's POST /backtest takes the finer candles as detail, the platform's answers carry report.inside_bars
(interval, own_bars and, when none were used, why), and report.config.bar_ms is the span the account was marked
on. How the engine walks a bar: How a Metrand backtest fills orders inside a bar.