Box every quiet range, act on the closing breakout, trail the stop
Range Breakout Scalper watches the last 20 bars on your TradingView chart, and when the middle of their high-low range stops moving for 5 bars it boxes that quiet range.
- Quiet ranges found by a fixed rule: the 20-bar range's midpoint unchanged for 5 bars, boxed with its height.
- Breakouts decided on the candle close, never on a wick, with the box turning teal or red.
- A red ATR trailing stop, 3 x ATR(14) from the breakout candle, that only moves towards price.
- Uses only the chart's own bars, so it runs on any symbol and timeframe, the free TradingView plan included.
- The full Pine Script source code. Paste it into the Pine Editor, save, and add “Range Breakout Scalper [AlgoFXStore]” to your chart.
- A 14-page PDF manual with installation, every setting and how to read the chart. One-time €47.

See Range Breakout Scalper on a real chart
Press play; use the full-screen button to see every detail.
A breakout only means something if you know which range broke
Most breakout trading starts with a box drawn by hand, and every trader draws it differently. Was the range the last ten candles or the last thirty? Where exactly is its top? By the time you have decided, price has often left, and the box you draw afterwards fits the move you already saw. That is why breakouts look obvious on an old chart and unclear while they happen.
The second mistake is acting on the first wick through the edge. Price pokes above the range high, the order fills, and the candle closes back inside. The other half of the problem is the exit: a fixed target cuts a strong move short, and a stop left at the entry gives back most of a move that has run. Both come from having no rule for when a range starts and when a move is over.
Range Breakout Scalper replaces the guesswork with one mechanical rule for each stage. A range counts as quiet when the middle of the 20-bar high-low range is the same as it was 5 bars ago, so no new extreme has pulled it away. A breakout counts only when a candle closes outside the box. The move is over when a candle closes back through an ATR trailing stop that has only ever tightened.
Everything Range Breakout Scalper draws on your chart
Read from the shipped Pine Script code.
- Consolidation box: when a quiet range is found, 16 stacked horizontal slices from the 20-bar lowest low to the 20-bar highest high, starting 5 bars before the detection bar; edges about 70 % transparent fading to clear in the middle (a gradient), grey (Mid Line Color) while the range waits for a breakout; the box grows to the right with every bar
- Range centre line: grey 1 px line at the middle of the box (Mid Line Color)
- Range label centred over the box: 'Range: <height>' in price (default), 'Range: <n> Ticks' or 'Range: <price> (<n> Ticks)'; above the box, moved under it after a bullish breakout
- Breakout colouring: the box slices turn the Bullish Color (teal) when a closed candle closes above the box, the Bearish Color (red) when it closes below
- Trailing stop: red 1 px line (Trailing Stop Color) that starts on the breakout candle 3 × ATR(14) beyond its low (bullish) or high (bearish) and only tightens; a light red band (90 % transparent) 1 ATR wide on the price side of the line; two red circles (one larger, half transparent) where it starts
- AlgoFXStore watermark bottom right
From a quiet range to a trailed move, in six steps
Everything below is read from the shipped Pine Script. The indicator runs one cycle at a time: it searches, boxes a range, waits, trails the breakout, and starts searching again.
- 1
Measure the last 20 bars
On every bar the indicator takes the highest high and the lowest low of the last 20 bars, Structure Length, and the price halfway between them. That midpoint is the whole test of quietness. While price keeps printing new 20-bar highs or lows, the midpoint keeps moving and nothing is drawn, so strong trends leave few boxes and sideways stretches leave many.
- 2
A quiet range is fixed
When the midpoint is exactly the same as 5 bars ago, Consolidation Bars, no new extreme has arrived and the range is fixed: top at the 20-bar high, bottom at the 20-bar low. It is drawn from 5 bars back as 16 thin horizontal slices, coloured at the top and bottom edges and clear in the middle, in the grey Mid Line Color, with a grey centre line through it.
- 3
The box waits without a time limit
The box and its centre line grow to the right with every new candle, and the label stays centred over the box, reading Range: and the height in price, in ticks or both. There is no expiry: the range waits until a candle closes outside it. While a box waits, no other range is searched, so only one box is ever in play.
- 4
A closed candle decides the breakout
A breakout needs a candle that has closed: the code checks barstate.isconfirmed. A close above the top is bullish, and every slice of the box turns the Bullish Color, teal by default, with the label moved under the box. A close below the bottom is bearish and turns the box red. The dashboard's Last Breakout row records the direction and that candle's close.
- 5
The trailing stop starts and tightens
On the breakout candle a red stop starts 3 x ATR(14) below that candle's low for a bullish breakout, or above its high for a bearish one, marked by two red circles. On each following bar a long stop moves up to the low minus 3 x ATR when that is higher and never moves down; a short stop mirrors it. A light red band 1 ATR wide sits on the price side.
- 6
Exit, tally and the next search
When a closed candle closes back through the stop, the move is over and the line ends. The indicator notes whether that close was beyond the breakout close in the move's direction, for the optional dashboard tally, and from the next bar searches for a new quiet range. No take-profit level is ever drawn: the trailing stop is the only exit the indicator shows.
Range Breakout Scalper on 12 different markets
Every chart below is a screenshot of TradingView itself with the shipped Range Breakout Scalper [AlgoFXStore] attached at its default settings. Forex, metals, indices, energy and crypto, so you can see how it reads each kind of market. They show what the indicator draws; they are not trading results. Tap or click any chart to open it full size.












Range Breakout Scalper on a real TradingView chart, frame by frame
Frames of a screen recording of the shipped indicator at its default settings, as the chart updates. Nothing is edited into the chart.




How to work a breakout, step by step
A routine built from the indicator's own rules and its manual. It is a way to read the boxes and size the risk, not a promise of a result.
- 1
Pick the market and timeframe
Start where the manual starts: 15 minute charts for gold, forex pairs and Bitcoin, and 5 minutes for the NASDAQ 100 in the US session. On a 1 minute chart raise Structure Length to 30 or 40, so a range covers more than a few minutes. Every length is counted in bars: a range on a 5 minute chart spans 100 minutes, on a 1 hour chart 20 hours.
- 2
Judge the grey box first
While a grey box waits, look at its size. Switch Range Display Format to Ticks or Both to compare its height with a normal candle: a box much smaller than an average candle often breaks out into noise. Check the 1 hour or 4 hour chart too, because a breakout in that chart's direction has the larger trend behind it, and note any clear old high or low just beyond the box.
- 3
Wait for the close outside
Act only when a candle has closed outside the box and the box has changed colour. A wick through the edge that closes back inside is not a breakout, and the indicator keeps waiting. Be careful with a very long breakout candle: the stop is measured from its far end, so a long candle means a wide stop and a small position, or an entry that is already late.
- 4
Size from the first stop
Read the first stop on the breakout candle from the price scale or the Data Window. The distance from the breakout close to that stop is your risk per unit. In the manual's gold example the close is 4412.355, the candle's low 4408.120 and ATR(14) 5.850, so the stop is 4408.120 minus 3 x 5.850 = 4390.570, which is 21.785 below the close. Size the position so that distance fits your risk.
- 5
Follow the stop, never widen it
You place and manage your own orders; the indicator never does. Move your stop to the red line as it tightens, or decide in advance to keep your first stop. The line never moves against you. If you want a target, it is your own rule: the manual's example is taking part of the position off after a move as tall as the box and trailing the rest.
- 6
Know when to stand aside
Several breakouts stopped out quickly in a row mean the market is choppy: wait for a cleaner phase. Breakouts in the seconds after a major data release can reverse just as fast, so wait for the first candle after the release to close. Count spread and commission on 1 and 5 minute charts, where they are a large part of every move.
The dashboard, row by row
- Last Breakout | BULLISH/<breakout close> in the Bullish Color or BEARISH/<breakout close> in the Bearish Color; None/NaN until the first breakout
- Closed Trades | <n>: breakouts ended by their trailing stop on the loaded bars, counting at most the last 100 (Stats Lookback Trades) (optional: Show statistics rows)
Everything Range Breakout Scalper does for you
Ranges found by a rule, not by eye
A range is boxed only when the midpoint of the 20-bar high and low is unchanged for 5 bars. Both lengths are inputs, so you decide how wide the ranges are and how long the market has to stay quiet before a box appears.
A box you can read through
Sixteen stacked slices with colour at the edges and a clear middle keep the candles inside visible. Grey while the range waits, teal after a bullish breakout, red after a bearish one, with a grey centre line through the middle.
Range height in price or ticks
The label over each box reads its height in the symbol's own price precision, as a count of ticks, or both. A tick is the symbol's smallest price step, so on five-digit forex pairs one tick is a tenth of a pip.
Breakouts on the close only
Both the breakout and the trailing-stop exit require a closed candle, checked with barstate.isconfirmed. Once a box has turned teal or red, or a stop line has ended, that stays as it is afterwards.
A stop that follows the move
It starts 3 x ATR(14) from the breakout candle's low or high and is then tightened bar by bar, never loosened. Trailing Stop ATR Length and Trailing Stop Multiplier, from 0.1 in steps of 0.1, set how much room it gives.
A band that shows the distance
A light red band, 1 ATR wide, sits on the price side of the stop, so you see at once when price is pressing on it. Two red circles, one larger and paler, mark the candle where the stop started.
A small dashboard, top right
Last Breakout shows BULLISH or BEARISH with the breakout close. Two optional rows, Closed Trades and Wins %, count how the trailed breakouts ended on the loaded bars; Show statistics rows switches them off.
One thing at a time
One range or one trailed breakout at a time, with no arrows and no stacked labels. Bullish boxes, bearish boxes, the centre line and the trailing stop each have their own colour input in the Color Settings.
Only the chart's own bars
No request.security, no other timeframe and no seconds data: it reads only the bars of the chart it sits on, so it runs on any symbol and timeframe, and on the free TradingView plan.
Range Breakout Scalper, feature by feature
Each picture is built from real platform screenshots of the shipped indicator at its default settings, labelled so you can see what every part does. Tap any picture to open it full size.








How traders put it to work
Gold on 15 and 5 minutes
The manual starts gold on 15 minute charts and drops to 5 minutes for the London and New York sessions. Gold often goes quiet before the US session and breaks out at it. The stop is measured in ATR, so it widens on fast days and the position shrinks with it; nothing needs retuning between quiet and busy weeks.
Forex pairs in the main sessions
On EURUSD, GBPUSD and USDJPY the starting point is 15 minutes, or 5 minutes in the London and New York sessions. In the quiet Asian session ranges form often but break out weakly. Switch the label to Ticks to read box heights in the pair's smallest step, a tenth of a pip on five-digit quotes.
Indices around the cash open
Indices such as the NASDAQ 100, US30 or GER40 form many ranges before the US cash open at 09:30 New York and break out at it. Start on 5 minutes; for fast 1 minute scalps the manual suggests Structure Length 30. Stocks start on 15 minutes or 1 hour, and their overnight gaps can jump straight out of a box.
Crypto around the clock
Bitcoin and other coins trade all week, so ranges form at any hour. Start on 15 minutes and move to 1 hour for fewer, larger ranges. Weekend ranges are thinner and false breakouts more common. A higher Consolidation Bars value boxes only the longer quiet phases.
Tighter or looser trailing
For tighter scalps the manual suggests a Trailing Stop Multiplier of 2.0 to 2.5: the stop is hit sooner and each move risks less. The default 3.0 gives a breakout room to come back and retest the box before it runs. Changing the multiplier never moves a box or a breakout, only the stop.
Every setting, with its default
The names are the ones in the script's Settings dialog in TradingView (Inputs tab); the defaults are what every chart on this page uses.
(no group header, top of the Inputs tab) (2)
| Setting | Default | What it does |
|---|---|---|
| Structure Length | 20 | Bars for the highest high and lowest low that make the range top and bottom (from 1). |
| Consolidation Bars / Length | 5 | The range midpoint must be the same as this many bars ago to mark a quiet range (from 1). |
Display Settings (1)
| Setting | Default | What it does |
|---|---|---|
| Range Display Format | Price | The range label shows the height in Price, Ticks or Both. |
(no group header, listed below Display Settings) (3)
| Setting | Default | What it does |
|---|---|---|
| Trailing Stop ATR Length | 14 | ATR period of the trailing stop distance (from 1). |
| Trailing Stop Multiplier | 3 | Stop distance in ATR from the candle's low (bullish) or high (bearish) (from 0.1, step 0.1). |
| Stats Lookback Trades | 100 | How many of the latest closed trades the statistics rows count (from 1). |
Color Settings (4)
| Setting | Default | What it does |
|---|---|---|
| Bullish Color | #0AA797 (rgb 10,167,151) | Boxes after a bullish breakout and bullish dashboard text. |
| Bearish Color | red | Boxes after a bearish breakout and bearish dashboard text. |
| Mid Line Color | #BEC1CC (rgb 190,193,204) | The range centre line, and the boxes of a range still waiting for its breakout. |
| Trailing Stop Color | red | The trailing stop line, its band and its start circles, for both directions. |

Range Breakout Scalper next to the usual options
Where it wins, and where it does not.
| Range Breakout Scalper | Typical free breakout indicator | Reading it by hand | |
|---|---|---|---|
| Finding the range | A fixed rule: the 20-bar midpoint unchanged for 5 bars | Often a fixed session or time window | You choose the box each time |
| When a breakout counts | Only on a candle close outside the box | Depends on the script | Yes, if you wait for the close |
| Stop after the breakout | ATR trailing stop that only tightens | Usually none | You calculate and move it yourself |
| Range height shown | In price, ticks or both | Rarely | You measure it |
| Built-in alerts | None: you set TradingView's own alert on the Trailing Stop line | Depends on the script | Only the alerts you set on your own lines |
| Take-profit target | None drawn: the trailing stop is the exit | Depends on the script | Any target you like |
| Several ranges at once | No: one range or one breakout at a time | Depends on the script | As many as you can watch |
Honest about who this fits
A good fit if you
- You trade breakouts and want the range defined by a fixed rule instead of drawn by eye on every chart.
- You scalp or day trade on 1 to 15 minute charts in gold, forex pairs, indices or crypto.
- You want a breakout to count only on a candle close, and a stop that follows the move without your recalculating it.
- You size positions from the stop distance and like having that distance on the price scale the moment the breakout prints.
- You prefer a quiet chart: one box, one stop and a small dashboard instead of stacked arrows and labels.
Not for you if you
- You want BUY and SELL arrows or built-in alert messages: the indicator has neither, and alerts come from TradingView's own price-crossing alert on the Trailing Stop line.
- You want take-profit levels drawn for you: there are none, and the trailing stop is the only exit the chart shows.
- You want an automated system: it draws ranges, breakouts and a stop, and you place and manage every order yourself.
- You trade strong one-way trends on higher timeframes: in a trend the midpoint keeps moving, so few ranges are boxed there.
The full code, one manual, installed in two minutes
- 1Pine Script source codeRange_Breakout_Scalper_TradingView_Code.txt (11 KB): the full code. Paste it into the Pine Editor and it appears as “Range Breakout Scalper [AlgoFXStore]”.
- 14Page PDF manualInstallation, every setting with its default and how to read the chart.
- ✓Every main setting explainedThe table above lists the main settings with the defaults the charts use.
- 60Day money-back guaranteeIf it is not for you, request a full refund within 60 days through your Digistore24 order e-mail.
Install in five steps
- Download the zip from the page Digistore24 sends you to after checkout and unzip it.
- Open Range_Breakout_Scalper_TradingView_Code.txt in a text editor, select all and copy the whole code.
- In TradingView, open the Pine Editor, paste the code over everything that is there and click Save.
- Click Add to chart: “Range Breakout Scalper [AlgoFXStore]” appears on your chart.
- Read the PDF manual; the defaults are the settings shown on this page.

Kestutis Balciunas
AlgoFXStore · chart indicators
Kestutis Balciunas builds and publishes chart indicators under the AlgoFXStore name. Every product page shows what the indicator draws on real charts, and every number on it comes from the shipped build.
The charts on this page were captured in TradingView from the shipped Range Breakout Scalper [AlgoFXStore] at its default settings and are shown unedited.
No get-rich claims and no quoted win rates. Every trade is uncertain, and no indicator changes that. If you want to know whether it suits the way you trade before you buy, e-mail [email protected] and you will get a straight answer.
One price, one payment
- The full Pine Script source code of Range Breakout Scalper and the 14-page PDF manual
- Delivered as a digital download: one zip with the code file and the PDF manual on your download page
- Return period: 60 days, with a full refund if it is not for you
- Free updates to the current version on the same download page
60-day money-back guarantee. Install it, run it on your own charts and read the manual. If Range Breakout Scalper is not for you within 60 days of purchase, request a full refund from Digistore24, no questions asked: use the refund link in your Digistore24 order e-mail or Digistore24's order page digistore24.com/en/cancel-revoke-contract. Digistore24 refunds to your original payment method. It is a digital download: right after checkout you land on your download page, and the link to it is also in your Digistore24 order e-mail.
About ranges and breakouts
Does it repaint?
Breakouts and exits are decided on closed candles: both checks require barstate.isconfirmed, so a box never turns teal or red, and a stop never starts or ends, before the candle has closed, and that result stays. Two things can still move on the forming candle. The quiet-range check runs on every price update, so a new grey box can appear and vanish again if a new high or low arrives before the close. And the stop's value for the forming candle is final only at its close. There is no request.security and no other timeframe.
What exactly counts as a quiet range?
The indicator takes the highest high and the lowest low of the last 20 bars and the price halfway between them. When that midpoint is the same as 5 bars ago, neither a new high nor a new low has pulled it, and the range is fixed at that 20-bar high and low. Raise Structure Length for wider ranges that form less often, or Consolidation Bars to demand longer quiet phases.
Why are there no BUY or SELL arrows?
The signal is the breakout itself, shown three ways: the box turns teal or red, two red circles mark the candle where the trailing stop starts, and the dashboard's Last Breakout row names the direction and the breakout close. Nothing else is printed on the candles.
Why did a wick through the edge not count?
Because a breakout needs a close outside the box, not a touch. A candle that pokes above the top and closes back inside leaves the box grey and waiting. The close decides, so a spike that is rejected straight away starts neither a move nor a stop.
Is there a time limit on a box?
No. A box waits without expiry until a candle closes outside it, growing to the right bar by bar. While it waits, and while a breakout is being trailed, the indicator does not look for another range, so only one box is in play. If a box has been waiting a long time, price is simply still inside it.
The stop and the dashboard
How is the trailing stop calculated?
On the breakout candle it starts at that candle's low minus 3 x ATR(14) for a bullish breakout, or its high plus 3 x ATR(14) for a bearish one. On each later candle a long stop moves to the low minus 3 x ATR if that is higher; a short stop moves to the high plus 3 x ATR if that is lower. It never moves back, and a candle closing through it ends the move.
Why is the stop red when price goes up?
Because it is the stop loss of the move, and red marks where a trade is wrong, for bullish and bearish breakouts alike. The box keeps the direction colour, teal or red. If you prefer another colour, change Trailing Stop Color in the Color Settings; it colours the line, its band and its start circles.
Is there a take-profit level?
No. The indicator draws no target; the trailing stop is the exit. If you want one, set your own rule. The manual's example is taking part of the position off once price has moved as far as the box is tall and trailing the rest with the red line. That is your decision, and the indicator does not draw it.
What do the dashboard rows mean?
Last Breakout shows BULLISH or BEARISH and the close of the newest breakout candle, in teal or red; it reads None/NaN until the loaded history has a breakout. Closed Trades counts the breakouts the stop has ended, up to the last 100 (Stats Lookback Trades), and Wins % how many of those ended with a close beyond the breakout close. Both are hindsight bookkeeping of the loaded bars without spread, commission or slippage, not a backtest. Show statistics rows switches them off.
Settings, charts and alerts
Does it send alerts?
Not by itself: the code has no alertcondition and no alert() calls. TradingView can still watch the stop for you. In Create alert choose the symbol, then Crossing, then the indicator's Trailing Stop plot; Once per bar close matches the indicator's own close rule. The line exists only during a move, so that alert fires only while a breakout is trailed. To hear about a breakout, draw horizontal lines at the box edges and add an alert to each.
Which timeframes and symbols does it work on?
Any symbol and any timeframe, because it reads only the chart's own bars. All lengths are counted in bars: a 20-bar range on a 5 minute chart covers 100 minutes, on a 1 hour chart 20 hours. It is built for scalping and day trading on 1 to 15 minute charts, while 1 hour charts give fewer, larger ranges. There is no session filter.
What does the Ticks display mean?
Range Display Format sets the label over each box. Price shows the height in the symbol's own precision, Ticks shows how many of the symbol's smallest price steps fit into it, and Both shows the two together. On five-digit forex pairs one tick is a tenth of a pip, so the tick count is ten times the pip count.
Why do old ranges show only a centre line?
TradingView keeps a limited number of drawings per indicator: 500 boxes, which is about 31 ranges of 16 slices, and 50 labels. Beyond that the oldest boxes and labels are removed first, so far back in history a range keeps only its centre line. Recent ranges are always complete. Counting starts at the first loaded bar, so with a different history length the oldest ranges can differ.
Can I combine it with other indicators or run it on several charts?
Yes. It sits on the price chart as an overlay, with its dashboard top right and the AlgoFXStore watermark bottom right, so place other panels elsewhere. Each chart runs its own copy with its own ranges and stop. The Style tab lists the Trailing Stop, its fill and the start circles, where you can hide them or change their width.
Which settings should I change first?
Usually none. The defaults are Structure Length 20, Consolidation Bars 5, Trailing Stop ATR Length 14 and Multiplier 3.0. On 1 minute charts raise Structure Length to 30 or 40, and for tighter scalps lower the Multiplier to 2.0 or 2.5. If strong trends leave no boxes, lower Consolidation Bars or try another timeframe. After a change, create any alert on the stop again, because an alert keeps the settings it was made with.
How it works
Will it place trades for me?
No. Range Breakout Scalper is an indicator: it draws on the chart. It never sends an order.
Do I need a paid TradingView plan?
No. It reads only the chart's own bars, so the free TradingView plan runs it. Alerts count against your plan's alert limit.
After you buy
How do I get it after paying?
Digistore24 runs the checkout. Right after payment it takes you to your download page with one zip holding the Pine Script source code file and the PDF guide; the link to that page is also in your Digistore24 order e-mail, so you can download again at any time.
How do I install it?
Open the code file, open the Pine Editor in TradingView, paste the whole code, click Save and then Add to chart: “Range Breakout Scalper [AlgoFXStore]” appears on your chart. The guide walks through it step by step.
Who is Digistore24?
Digistore24 is the reseller that sells Range Breakout Scalper for Kestutis Balciunas (AlgoFXStore): it runs the checkout, charges your card or PayPal, collects the VAT for your country and delivers the download. Its name is the one on your statement, and its order e-mail holds your download link and the refund link.
What is the refund policy?
A 60-day money-back guarantee, handled by Digistore24. If Range Breakout Scalper is not for you within 60 days of purchase, use the refund link in your Digistore24 order e-mail or Digistore24's order page (digistore24.com/en/cancel-revoke-contract) for a full refund, no questions asked. Digistore24 makes the refund to your original payment method.
Do I get the source code?
Yes. You get the full Pine Script source code as a text file for your own use; the licence line at the top of the code does not allow resale, sharing or republishing.
Range Breakout Scalper for TradingView.
Let the chart box the quiet ranges, wait for the closing breakout, and follow every move with a stop that only tightens. The full code, the manual and every setting explained. Instant download for €47, one payment.
Get instant access