Range bars: how they are built, what size to set, how to backtest
Range bars close when price has covered a fixed distance, not when a clock interval ends, so busy markets print many bars and quiet markets print few. That changes trade counts, indicator lookbacks, time filters and fill assumptions, so a range bar strategy needs tick data and a cost check before its backtest means anything.
By Soren Huang · Published · updated · Editorial policy
Contents
- What are range bars and how is a range bar built?
- What range size should you set?
- Range bars vs Renko: what is the difference?
- Range bars vs time bars: what changes in a backtest?
- What are the backtest pitfalls with range bars and other non-time bars?
- What does a stand-in test on fixed time bars show?
- Frequently asked questions
- References
What are range bars and how is a range bar built?
Range bars are price bars that close when price has covered a fixed distance, for example 10 ticks, instead of when a clock interval ends. The chart counts movement, not minutes: a fast market prints many bars, a quiet market prints few, and a futures backtest on range bars changes its trade count, bar count and fill assumptions with it.
A range bar is a bar whose high minus its low equals a fixed size chosen in advance, and which closes the moment price reaches that size. The next bar opens on the next tick. Because the bar closes at the edge of its range, its close is always at its high or its low. Think of a car odometer that rings a bell every 10 kilometres: on a motorway the bell rings every few minutes, in city traffic it may stay silent for an hour. The bell measures distance, not time. Range bars are the odometer of a price chart.
On Nasdaq-100 E-mini futures (NQ) one tick is 0.25 index points and is worth $5.00 per contract, so a 10-tick range bar is a 2.5-point bar worth $50 of movement per contract. Exchanges can change tick sizes and point values, so check the exchange's contract page before you set a range; the free futures contract calculator shows tick size and tick value for the main contracts and turns a range in ticks into dollars.
Three things follow for a backtest. First, the number of bars in a day is not fixed, so "100 bars of history" is a different amount of time on every day. Second, bars have no gaps between them inside a session, because each bar opens where the previous one closed, unless a session break or a jump forces one. Third, a bar is only known to be complete when the tick that reaches the range prints, which matters for execution and is covered in the pitfalls section.
What range size should you set?
Set the range from the market's typical movement, as a fraction of its average daily range or of an ATR reading, and then test the sizes next to it. A range size that is the only one that works is a warning, not a setting. The range decides how many bars and therefore how many signals the same rule produces in a day, so it behaves like any other parameter and deserves the same test.
- Measure the market's movement. Take the average daily range (high minus low) over the last year, or a 14-day ATR, in ticks.
- Pick a starting fraction. A range near 1 to 2 percent of the daily range gives a bar count similar to short intraday time bars on an active day; 5 percent or more gives a few bars per day. These fractions are a starting point, not a rule.
- Run the neighbouring sizes. Test the chosen range and at least two sizes above and below it with the same rule and costs.
- Compare average trade after costs across sizes. Smaller ranges mean more trades, a smaller move per trade and a larger share taken by commission and slippage.
- Keep a size inside a flat region. If 10 ticks looks good and 8 and 12 look poor, the result is tied to one slice of history. Pardo (2008) describes this test of neighbouring parameters as a basic step in evaluating any optimized setting.
Hypothetical example
Suppose NQ has an average daily range of 300 index points, which is 1,200 ticks. A range of 1 percent of that is 12 ticks (3 points, $60 of movement per contract). You test ranges of 8, 12, 16, 20 and 24 ticks with the same breakout rule and a $30 round-trip cost. The 8-tick run produces 1,400 trades a year with an average trade of $12 before costs, so costs eat more than everything. The 16-tick run produces 500 trades a year at $45 before costs and $15 after. The 20- and 24-tick runs land near $18 and $16 after costs. The flat region from 16 to 24 ticks is the region to work in; 8 ticks is a cost problem, not a strategy.
Range size and rule parameters interact. A 20-bar lookback on 5-tick bars sees a few minutes of price; the same lookback on 20-tick bars sees most of a morning. Treat the pair of range size and lookback as one setting and test them together, with the pass thresholds written before you look, which is what strategy validation in AlphaPrime (Valynox) is built to hold constant from one candidate to the next.
Range bars vs Renko: what is the difference?
Range bars record the real high, low and close of each move, while Renko bricks are fixed-size steps drawn only when price moves a full brick, so Renko results are harder to reproduce in a backtest. Both bar types ignore time. The difference is how much of the price path they keep.
A Renko brick is a block of fixed height that is drawn when price moves a full brick size beyond the last brick, up or down, with no wicks and no record of the ticks inside it. A reversal brick is usually drawn only after price moves two brick sizes against the last brick, so small pullbacks never appear. When price jumps several brick sizes in one move, several bricks are drawn at once, and many charting programs do not finalize the current brick until the next one forms, so the brick can look different while it is forming and after. Range bars keep the wicks: price can move up 6 ticks, down 9 ticks and then up 10 ticks from the low, and the bar records that path as a high, a low and a close.
| Property | Range bars | Renko bricks |
|---|---|---|
| Bar closes when | High minus low reaches the range size | Price moves one full brick beyond the last brick |
| Keeps high and low | Yes, with wicks inside the range | No, only the brick's open and close |
| Reproducible from tick data | Yes, one tick series gives one bar series | Depends on the brick rule and the price source used (close or high/low) |
| Reversal rule | None, the next bar simply opens | Usually two brick sizes against the trend |
| Price gaps | Only at session breaks or jumps | Several bricks drawn at once on a jump |
For backtesting this matters in two ways. A rule that reads the wick, such as the candlestick patterns tested on futures bars, has less to read on a range bar, where the close always sits at the high or low, and nothing to read on a Renko brick. And a Renko backtest that looks smooth may owe part of its smoothness to the bricks hiding the pullbacks that would have hit a stop in real trading.
Range bars vs time bars: what changes in a backtest?
On time bars every bar is one fixed interval, on range bars a busy hour becomes many bars and a quiet hour becomes few, so indicator lookbacks, time-of-day filters and trade counts all mean something different and have to be re-read. A rule carried from 5-minute bars to range bars without re-reading is a new, untested rule.
| What you read | Time bars (for example 5-minute) | Range bars (for example 10 ticks) |
|---|---|---|
| Bars per day | Fixed by the session length | Varies with volatility, often several times more on a news day than on a quiet day |
| 20-bar lookback | Always 100 minutes | Minutes at the open, hours at midday |
| Time-of-day filter | Bar open time is known in advance | Only the bar's completion time is known; a bar can start before and end after the filter line |
| Trades per day | Roughly steady | Clustered in volatile stretches, where slippage is also highest |
| Daily statistics (session count, breadth, volume by time) | Line up one to one with the bars | Do not line up; one daily value spans a changing number of bars |
The lookback row is the one most traders miss. A moving average or an oscillator from the guide to technical analysis tools and indicators is defined over N bars, so on range bars it adapts to volatility by itself: it reacts fast when the market moves and slows down when it rests. That is a reason traders like range bars, and also a reason an indicator setting tuned on time bars does not transfer. The last row matters for filters built from daily data. The market breadth indicators for index futures are computed once per session from the whole market, so a range bar rule that uses them must read the previous session's value on every bar of today, not a value that does not yet exist.
What are the backtest pitfalls with range bars and other non-time bars?
Four mistakes make a range bar strategy look better than it can trade: building the bars from minute data instead of tick data, assuming fills at the exact range limit, mishandling session breaks and gaps, and reading a bar before it is complete. Each one adds a little to the backtest and takes it back in live trading.
- Bars built from minute data. A range bar needs every tick to know the moment the range is reached. Built from 1-minute bars, the chart only knows that the range was reached somewhere inside a minute, and it usually assigns the close to the minute's close, which can be several ticks past the range. The bar series, the signal times and the fill prices all differ from a tick-built series, and the difference is largest in the fast stretches where most trades happen.
- Fills at the range limit. A range bar closes on the tick that reaches the limit, so a strategy that trades "on the close" of a range bar gets a price that was the last tick printed. In a fast market the next tick is often further along. Fill at the next tick, charge slippage, and test with double slippage to see how much of the result depends on cheap fills.
- Session breaks and gaps. When the session ends with a bar half built, or the market reopens far from the last close, the chart has to close a bar out of range or open one with a gap. Decide how your chart handles this, apply the same rule in the backtest and the live chart, and make sure a signal cannot fire across a break it could not have traded.
- Lookahead from incomplete bars. Lookahead bias is the use of information in a backtest that would not have been available at the time of the trade. A range bar's high, low and close are only final when it completes, so any rule that reads the current bar and fills inside it is reading the future. Decide on the completed bar and fill on the next tick or the next bar.
The second and fourth pitfalls are execution rules, and they apply to every bar type. The backtesting in AlphaPrime charges commission and slippage on every trade and fills on the next bar after the signal, so a candidate ranked at the top already carries the costs and the one-bar delay that a range bar fill at the limit would hide. The first pitfall is a data question: a range bar backtest is only as good as the tick series under it, so check where your range bars come from before trusting the result.
What does a stand-in test on fixed time bars show?
A range bar series depends on the tick data behind it, so we show how to read a run on fixed time bars first, and then describe what to compare when the same rule is moved to range bars. The run below is a stand-in: it tests an N Day rule on NQ daily bars, not a range bar strategy. An N Day rule compares today's price with the highest and lowest prices of the last N days, the same family as the Donchian channel breakout rules and settings, and it was the only entry and exit, with no stop, no target and no filters.
Source: AlphaPrime product engine (CPU), run 2026-10-31. NQ daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $10 slippage per trade.
| Number | Result |
|---|---|
| Net profit (closed trades) | $145,750 |
| Max drawdown | $129,920 |
| Trades | 78 |
| Win rate | 75.64% |
| Profit factor | 1.67 |
| Average trade | $1,868.59 |
| Time in market | 90.69% |
This run tested NQ daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $10 slippage per trade. It is the one candidate the search kept out of the 1,024 it tried, chosen for its return against its drawdown. Picking the kept candidate after the fact flatters it: the best of 1,024 tries carries a selection bonus that a single fresh test would not, which is the effect Bailey, Borwein, López de Prado and Zhu (2014) describe. The numbers say what this rule did on this history; they do not say what the rule or the indicator earns, and they are not what a reader should expect.

Three readings carry over to range bars. First, 78 trades in about six and a half years is about one trade a month, with a time in market of 90.69 percent, so the rule was almost always holding a position and simply flipped sides. On range bars the same rule fires many times more often, so expect the trade count to rise sharply and the average trade to fall. Second, the average trade of $1,868.59 is about 60 times the $30 round-trip cost; on 10-tick range bars the average trade shrinks toward a few ticks, and the same $30 becomes a large share of it, which is why the range size test in the second section is a cost test. Third, the max drawdown of $129,920 is close to the net profit of $145,750. A drawdown almost as large as the profit, on one contract, is the number that decides whether a trader could have held through it, and it is the first number to re-check after moving to range bars, where the clustering of trades in volatile stretches can make drawdowns deeper and faster.

The next step is a test you can run yourself: take one rule you already trust on time bars, build range bars from tick data at three sizes chosen from the market's ATR, run the rule with next-bar fills and your real costs, and write down trade count, average trade after costs and max drawdown for each size. If the average trade after costs on the smallest size is below two round-trip costs, drop that size before you look at anything else.
Frequently asked questions
What are range bars in trading?
Range bars are price bars that close when the distance from the bar's high to its low reaches a fixed size, such as 10 ticks, instead of when a clock interval ends. Active markets print many range bars and quiet markets print few. The close of a range bar is always at its high or its low, because the bar ends on the tick that completes the range.
What range size should I set for range bars?
Start from the market's own movement: a fraction of the average daily range or a multiple of the ATR, converted to ticks. Then test two or three sizes on each side with the same rule and the same costs. Keep a size inside a region where the neighbouring sizes give similar results after costs, and avoid the smallest sizes if the average trade after costs falls below about two round-trip costs.
What is the difference between range bars and Renko?
Both ignore time, but a range bar keeps the real high, low and close of each move, with wicks, while a Renko brick is a fixed-height step with no wicks that is drawn only when price moves a full brick, and usually needs two bricks to reverse. Range bars can be rebuilt exactly from the same tick data; Renko bricks depend on the brick rule and the price source, and several bricks can appear at once when price jumps.
How do I backtest a range bar strategy?
Build the range bars from tick data, not from minute bars, so the bar closes at the right tick. Decide on the completed bar and fill on the next tick or next bar with commission and slippage charged. Handle session breaks and gaps the same way in the backtest and on the live chart. Then test the range size as a parameter, with neighbouring sizes, and compare average trade after costs and max drawdown across them.
Do indicator settings from time bars work on range bars?
Not without re-testing. An indicator lookback of 20 bars is 100 minutes on 5-minute bars but a changing amount of time on range bars, short in fast markets and long in quiet ones. Time-of-day filters also change meaning, because a range bar's time is its completion time. Treat a rule moved to range bars as a new rule and test it from the start.
References
- CME Group. E-mini Nasdaq-100 Futures contract specifications (contract size $20 × index, minimum tick 0.25 index points = $5.00). cmegroup.com/markets/equities/nasdaq/e-mini-nasdaq-100.contractSpecs.html
- Pardo, R. (2008). The Evaluation and Optimization of Trading Strategies (2nd ed.). John Wiley & Sons.
- Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.

