Range Trading Strategy|How to Trade and Backtest a Range
Build rules for fading the top and bottom of a range, tell it apart from a breakout, and backtest the round trips on past charts. Includes two sample rules.
Buy support, sell resistance, collect the range — so you fade the edge, and it turns out that edge was the start of a breakout, and the round trip you wanted runs you over as a trend takes off. If you've traded ranges, this probably sounds familiar. A range gets called "easy because the top and bottom are set," but when where the range boundaries are and when the range breaks are left vague, it's a setup where round-trip trades keep getting caught in breakouts.
This article is a deep dive on range (box) trading, one of the setups listed in 8 Core Trading Strategies Explained. We'll cover how it differs from trend following and breakouts, how to pin down the top and bottom of a range, how to confirm a bounce at the edge, how to deal with the "end" of a range, and how to write it into ENTRIQ's strategy-rule field (with two sample entries). This isn't about predicting where price goes. It's about putting your rules into words so you can test them on past charts, over and over.
What range (box) trading is
A range is a state where price moves back and forth between a set ceiling (resistance) and floor (support). It's also called a "box" or "consolidation." Range trading rides that round trip — buying near the floor and selling near the ceiling (or selling the ceiling and buying back at the floor) — to take the swing between the two.

Lining it up against trend following makes the difference clear. Where trend following rides a "directional flow," range trading takes a "directionless round trip." It works best in exactly the phase where there's no trend — where going with the trend tends not to mesh. In fact, the range phases where trend-side tools like the moving average are said to "work poorly" are, seen another way, an opportunity for round-trip trades.
It's a close cousin of mean reversion, but the emphasis differs. Mean reversion targets "the reversal of an overextended move"; range trading assumes a round trip between a clear ceiling and floor. Where mean reversion measures overheating, range trading has "where it stops (the edge)" plainly visible on the chart.
Range trading has two cores. One is deciding "where the ceiling and floor are." The other is deciding "when the range ends (price clears the edge)." It looks like a story about taking round trips, but really how you prepare for the end of the range is what decides win or loss.
How to pin down the ceiling and floor
How traders draw the "edges" of a range varies. Rather than calling any one method correct, here are the common ones, laid out neutrally. Which you adopt is something to verify with your own backtest data.
| Reference | The idea | Watch out for |
|---|---|---|
| Number of bounces | Treat a level rejected (bounced) several times in the same zone as the ceiling / floor | One or two touches isn't enough to call an "edge" |
| Wick or body | Decide whether you read the edge breaking on a wick or on the close (body) | Counting a momentary wick-break as a break gets you whipsawed |
| Box height | Check whether the gap between ceiling and floor is worth trading | Too narrow and fees / spread eat the edge |
| Flat or sloped | Distinguish a flat range from a gently sloped parallel channel | Ignore the slope and you misread where the edge is |
| Midline (mid-range) | Use the midpoint between ceiling and floor to gauge which side has the edge | Near the middle there's no direction and it's poor for round trips |
Let's look at each a little more concretely.
Number of bounces
The most basic reference is counting how many times price has been rejected in the same zone. Price rises to a level and gets capped, rises again and gets capped — only after this repeats two, three times does the level mean something as a "ceiling (resistance)." The floor (support) is the same: the more times a zone has held, the more reliable it is as the edge of a range.

The catch is that one or two bounces isn't enough to call it an "edge." Decide a level that happened to stop once is the ceiling, and you start taking round trips before a range has even formed, then get run over as price runs one direction. If you use bounce count, decide for yourself "how many bounces before I call it a range," and confirm in backtesting that the threshold fits your symbol and timeframe.
Wick or body
This sets your standard for calling the edge "broken" — do you read it on a wick (a momentary poke through) or on the close (body)? The edge of a range often pokes past for a moment on a wick and snaps right back inside. Count that wick-poke as a "break" and you'll either quit a round trip while price is still inside the range, or chase the breakout direction and get pushed back.

The catch is that each standard has a tradeoff. Reading the close avoids wick fakeouts, but waiting for the close delays your call. Reading the wick is faster but gets whipsawed more. Whether you're aiming for a bounce at the edge or judging the switch to a breakout, setting this "wick or body" standard up front matters especially in range trading.
Box height
This checks whether the gap between ceiling and floor is worth trading. Round-trip trading takes the swing by "buying the floor and selling the ceiling," so if the box is thin to begin with, the swing you can take is small too. Round-tripping many times in a narrow range can still leave nothing after fees and spread.

The catch is that "pass on a too-narrow range" is a needed judgment. A small-height range may show plenty of round trips, but the take per trip is small, and the risk-reward tends to worsen against your stop. If you use height as a reference, decide a floor like "I don't trade unless it's this tall," and confirm in backtesting that it's reasonable against the symbol's volatility.
Flat or sloped
This distinguishes whether a range is flat (a sideways box with roughly parallel ceiling and floor) or a gently sloped parallel channel. The textbook box is flat, but in real markets the ceiling and floor often both drift gently up (or down) into a parallel channel. Miss the slope and you misread where the edge sits as time passes.

The catch is that a sloped channel is also a kind of trend, so it differs in nature from a pure round trip. In a gently rising channel, buying at the floor (an up-sloping support line) is closer to a trend-direction pullback buy, while selling at the ceiling is a counter-trend fade against the trend. Without distinguishing flat from sloped, the same "bounce at the edge" gets ambiguous about whether it's going with or against the trend.
Midline (mid-range)
This draws the midpoint between ceiling and floor (the mid-range) as a reference line, and gauges the edge of a round trip by whether price sits above or below it. In the lower half from floor to midline, the buy side has the edge; in the upper half from midline to ceiling, the sell side does — switching your bias by "position" within the range.

The catch is that near the middle there's no direction and it's poor for round trips. When price is near the midline, it's far from both ceiling and floor, and the case for fading a bounce is weak. If you use the midline, keep it as a support line for "only enter when price has leaned to an edge," and accept passing when price is near the middle.
The key point: these aren't mutually exclusive. Traders commonly stack several references to gauge the quality of a range — "treat a level bounced several times, read on the close, as the ceiling, and only fade when the height is sufficient and price has leaned to an edge."
How to deal with the "end" of a range
The scariest spot in range trading is when the range ends mid round-trip — price clears the edge and a trend begins. You'd sold the ceiling many times, so you sell again, and this time it breaks through and runs one direction — giving back, in one breakout, the profit your round trips had stacked.
That's exactly why range trading needs you to decide, as a pair, "fade the bounce at the edge" and "step aside when the range boundary breaks (or flip and go with the breakout)." Generally, when price clears the ceiling or floor clearly on the close, you call the range over and stop taking round trips. Draw this "graduation line" and you avoid the mistake of fading a trend's first leg over and over with round trips.
Seeing the edge of a range as "a place to fade a bounce" or as "a place to go with the breakout if it clears" are two sides of one coin. Range trading and breakout trading aren't opposing strategies — they're two ways of reading the same spot: does the edge bounce, or does it break? Keeping both in view and ruling the fork at the edge — "bounce means round trip; a close beyond means the breakout side" — is the realistic way to live with a range.
Define entries and exits together
With ranges too, most mistakes come from setting an entry condition and skipping the exit. A range especially produces a bigger loss when the range boundary breaks, so always put entries and exits into words as a pair.
Entry (when you get in)
- Where the ceiling and floor are (a level bounced how many times, read on the close)
- Where at the edge you enter (on reaching the edge, or waiting for a bounce bar)
- Height / position conditions (is the box tall enough, has price leaned to an edge over the middle)
Exit (when you get out)
- Stop: the price that admits the range is over (a clear close beyond the ceiling or floor)
- Target: where you take profit on the way back (just ahead of the opposite edge / the midline / a fixed distance)
Note that the target works differently from a trend. A range fades "the round trip from edge to edge," so taking profit as price approaches the opposite edge often fits better. Trying to stretch it like a trend can have you giving it back at the turn of the round trip. When the reason you entered (the round trip within the range) breaks, you exit. Setting up that pairing first is the core of building a range rule.
Sample strategy-rule entries (two patterns)
ENTRIQ's strategy tags include a strategy-rule field where you write down your own rules. Putting your range rules into words there lets you check, after every backtest, whether you actually entered the way you planned. There are two broad ways to write them. Neither is better — pick whichever lets you reproduce your decisions more reliably.
Pattern A: Discretionary (define the situation in words)
The discretionary style. You define context, entry, stop, exit, and skip conditions in words, without locking them to numbers.
Context: No clear trend, and a sideways range whose ceiling and floor have both bounced several times. Don't trade a sloped channel or a directional phase. Entry: Buy when price drops near the floor and prints a bounce bar. Consider a sell the same way near the ceiling. Stop: If price closes clearly below the floor, call the range over and exit. Exit: Take profit as price reaches just ahead of the opposite edge (the ceiling). Start thinking about it once price clears the midline. Skip: Don't enter when price is near the middle, when the height is narrow, or right before major data releases.
Pattern B: Rules-based (spell the conditions out in numbers)
The rules-based style. You fix the decision with indicators and numbers, so anyone reading it reaches the same conclusion.
Context: The recent N highs and lows sit in roughly the same zone (the ceiling–floor gap is within a set range). Entry: Buy when price drops to within the floor + (10% of the height) and the day closes back above the floor. Stop: Exit if the close drops below the floor (or floor −2%). Target: Take profit on reaching the ceiling − (10% of the height). Filter: The box height (ceiling − floor) must be at least a set fraction.
Numbers make your review quantitative and easier to aggregate in a backtest. But the figures here — 10% of the height, −2% — are only examples of how to write a rule. They don't guarantee any edge or profit. Backtest them on your own symbols and timeframes, and adjust as the data tells you.
Test it, then record it
Once your rules are in words, pull up past charts, find range phases, and run virtual entries and exits without seeing the future. After each one, log whether you entered by the rule and how you handled the end of the range (the breakout) in your trade journal and strategy tags.
One strategy tag per trade. Tag it something like "Range – floor bounce," and you can later pull up just those trades to see win rate, P&L, average risk-reward, and so on across the whole setup.
A caution here: don't take the numbers at face value while your sample is small. Judging a rule on 5 or 10 trades is far too early. Range trading is prone to a skew — "easy wins while the round trips continue, a big loss on the one breakout" — so build up enough repetitions to include that one breakout before you read the pattern.
The chart above shows how the data might look when you test different ways of entering (it's sample data, not real results). Same range, add a bounce confirmation or a height condition, different numbers — seeing that difference for yourself is the whole point of backtesting.
You can also review what you've logged with AI analysis. AI analysis isn't a trade signal or a recommendation — it identifies and describes patterns from your past trade data and notes. It can surface things you'd miss on your own, like "the trades I dove in on reaching the edge stopped out on breakouts more often."
Four common mistakes
- Starting round trips before confirming a range. Decide a level that stopped once or twice is the edge, and you get run over by a one-direction move before a range has formed. Confirm several bounces before you enter.
- Fading the edge with no stop. The edge of a range is also the start of a breakout. If your exit isn't tied to the edge, the end of the range runs your loss wide.
- Round-tripping a narrow range. When the swing you can take is small, fees and spread leave nothing. Confirm there's enough height to be worth it first.
- Not logging the one breakout. The round trips you won stick in memory, but the one big loss when the range ended is the one worth reviewing. Log the losses under the same strategy tag.
FAQ
Q. Is range trading the opposite of breakout trading? A. They're not opposing — they're the same "edge" read from opposite sides. Range trading bets on the edge bouncing; breakout trading bets on the edge breaking. That's exactly why, even in range trading, writing "a close beyond the edge ends the range" into your rule makes the switch from round trips to a breakout smooth.
Q. How is range trading different from mean reversion? A. Close idea, different emphasis. Mean reversion targets "the reversal of an overextended move," measured by the degree of overheating. Range trading targets "the round trip between a clear ceiling and floor," by the position of the edge on the chart. Mean reversion reads overheating; a range has the place it stops in plain view.
Q. How do I judge where a range starts and ends? A. There's no single right answer. You combine references — treat a level bounced several times as the ceiling / floor, read it on the close, check there's enough height. What matters most is setting, in advance, the line "a close beyond the ceiling or floor ends the range," and not fading a trend's start with round trips.
Q. Should I write the strategy-rule field discretionary or rules-based? A. Either works. If defining the situation in words is easier for you to reproduce, go discretionary; if you'd rather lock conditions to numbers, go rules-based. Writing both is fine too. What matters is that you can reproduce the same decision later.
Q. Which markets can I practice ranges on? A. ENTRIQ's backtesting supports US stocks, FX, commodities, and crypto. Japanese stocks are planned for a future release. You can also view multiple timeframes at once, which helps when you confirm whether there's a trend on the higher timeframe while taking round trips on a lower one.
Put "sell the top, buy the bottom" into words and it sounds simple, but whether you can profit from it comes down to pinning the ceiling and floor, preparing for the end of the range (the breakout), and your stop. Write how you draw the edges and your exit into the strategy-rule field as a pair, and test them on past charts again and again.
ENTRIQ is a chart replay and backtesting platform for individual traders, combining chart replay, trade journaling, and AI analysis.
This article does not guarantee the effectiveness or profitability of any strategy or rule. The figures and examples shown are samples to illustrate how to write rules, not indications of investment results. You are solely responsible for your own investment decisions.
Reproduce this validation yourself
With ENTRIQ's chart replay, you can trade through past charts using the same rules.
Start 14-day free trialValidate your method on past charts
The same validation in this article can be reproduced with your own method. On past charts, do the classics really work?
- ✓ Replay past charts
- ✓ AI feedback on your trades
- ✓ Validate methods with statistics