Matana Labs

1-second vs 1-minute backtesting

A backtest on bars only knows each bar’s open, high, low and close, so when one bar touches both your stop and your target it has to guess which came first, and it can’t see the price you really got when the stop was hit. In our simulation of trades with a 0.1% stop and a 0.2% target, a daily bar left 59% of exits unclear, and an engine that guessed “target first” showed +1.19R per trade where the true result was +0.03R. Second-by-second fills remove the guess, because each exit is booked at the second and the price it would have happened live.

How often the exit bar touched both the stop and the target: under 0.0% on 1-minute bars, 21.5% on hourly bars and 59% on daily bars with the tighter stop.
How often the exit bar touched both the stop and the target: under 0.0% on 1-minute bars, 21.5% on hourly bars and 59% on daily bars with the tighter stop.

The same-bar problem

Say you buy at 100.20 with a stop at 99.50 and a target at 101.50. If the next bar’s low is below 99.50 and its high is above 101.50, the bar tells you both levels traded, but not in which order. Was it a 1.3-point win or a 0.7-point loss? The bar can’t say. Every bar-based engine has to pick a rule, and the rule it picks changes your results.

The shorter the bar, the less often this happens, because a short bar rarely covers the distance between stop and target. But shorter bars don’t fix the second problem: the price you actually get.

A worked trade: one day, three answers

Here is one synthetic day we built for illustration: entry 100.20, stop 99.50, target 101.50, 100 shares.

Three engines, three results for one trade: a profit, a loss, and a loss 46% bigger. Over hundreds of trades these differences add up to a different strategy.

The same trade: a +$130 profit on a daily bar, −$70 on minute bars and −$102 second by second, where the price gapped through the stop.
The same trade: a +$130 profit on a daily bar, −$70 on minute bars and −$102 second by second, where the price gapped through the stop.

How bar-based engines guess

When a bar contains both levels, engines generally use one of these rules:

Stops are filled at the stop price in most bar engines, even when the market gapped through it. That is the fill-price problem, and it doesn’t go away with any of the four rules.

How often it happens: our simulation

We simulated a market that moves second by second with no trend (a random walk with a typical move of 0.05% a minute), opened 4,000 trades at random moments with the stop and target below, and followed each one second by second to see which level it really hit first. Then we looked at the bar that contained the exit, at five bar sizes, and counted how often that bar touched both levels.

Stop 0.1%, target 0.2%

Bars the backtest seesExits where one bar hit both stop and targetAverage trade if the engine guesses target firstIf it guesses stop firstSecond by second (truth)
1-minute0.0%+0.03R+0.03R+0.03R
5-minute0.1%+0.03R+0.03R+0.03R
15-minute3.3%+0.09R−0.01R+0.03R
1-hour21.5%+0.45R−0.19R+0.03R
Daily (6.5-hour session)58.6%+1.19R−0.57R+0.03R
On minute bars both guesses agree with the truth; on daily bars an optimistic engine turns a trade with no edge into +1.19R.
On minute bars both guesses agree with the truth; on daily bars an optimistic engine turns a trade with no edge into +1.19R.

Stop 0.25%, target 0.5%

Bars the backtest seesExits where one bar hit both stop and targetAverage trade if the engine guesses target firstIf it guesses stop firstSecond by second (truth)
1-minute0.0%+0.01R+0.01R+0.01R
5-minute0.0%+0.01R+0.01R+0.01R
15-minute0.0%+0.01R+0.01R+0.01R
1-hour1.1%+0.03R+0.00R+0.01R
Daily (6.5-hour session)24.5%+0.50R−0.24R+0.01R

On this market the true average trade is close to zero, as it should be with no trend. On 1-minute bars the exit bar almost never touched both levels (0.0%), but on hourly bars it did for 21.5% of trades with the tighter stop, and an optimistic engine on daily bars turned a strategy with no edge into one that made +1.19R a trade. Real markets have news spikes and fast gaps that this smooth model doesn’t, so the real numbers for short bars are higher than shown here.

The fill price problem: gaps through the stop

A stop order becomes a market order when its price trades. In a fast market the next price can be well beyond the stop, as in the worked trade, where the fill was 0.32 below. A bar engine that fills at the stop price books a smaller loss than you would have taken. For strategies with small stops, this slippage can be a large share of every loss, and it is invisible on minute bars because the bar’s low hides the order in which prices traded.

The fix is to fill at the first price that actually traded at or beyond the stop, at the second it traded, and to add your commission and an allowance for slippage on top.

What changes with second-by-second fills

Matana Labs (our product) fills every backtest second by second on every plan, on up to 23 years of history; the bars you see on the chart depend on the plan. It is not the only tool with second-level data, so check what each one uses for fills, not just for charts.

When minute bars are enough

Our own numbers show that 1-minute bars rarely hit the same-bar problem when stops are a few tenths of a percent away. Minute bars are usually fine when:

They are not enough for tight stops, fast markets, strategies that trade around news or the open, or rules that depend on intraday equity, like most prop-firm limits.

Tick data, second data and minute data

Tick data records every trade or quote. Second data summarises each second: its open, high, low, close and volume. Minute data does the same per minute. For deciding which of two levels traded first and at what price, second data answers almost every case that minute data can’t; ticks matter mainly when many prices trade within the same second, as in very fast markets or very large orders.

Updated 2026-11-19. Educational content, not financial advice.

Keep reading

See Matana Labs plans, from free

Questions

Is 1-minute data good enough for backtesting?

Often, if your stops and targets are wide compared with a typical 1-minute range and you add realistic slippage. It is not enough for tight stops, fast markets or rules that depend on intraday equity, because a minute bar hides the order of prices and the real fill after a gap.

What happens when the stop and target are hit in the same bar?

The backtest has to guess. Optimistic engines book the target, pessimistic ones the stop, others assume a path through the bar. In our simulation, an optimistic engine on daily bars made a strategy with no edge show +1.19R per trade.

What is intrabar backtesting?

Using data finer than the bar, such as seconds or ticks, to decide what happened inside a bar: which level was hit first and at what price. It removes the same-bar guess.

Do I need tick data to backtest?

For most strategies, second-level fills answer the same-bar question and the gap-fill question. Tick data matters mostly for very fast strategies where many prices trade inside the same second.

Does Matana Labs use second data for every plan?

Every backtest in Matana Labs fills trades second by second, on every plan. The chart bars depend on the plan, from 10-minute bars on the free plan to 1-second bars on Quant.