Indicator · Pine Script v5 · On the chart

Range XV [ATAS Style]

by pranay123-stack· code credited to Range XV Indicator - ATAS Style Range Bar Visualization

A price-chart overlay that groups bars into custom range blocks.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code128
Settings11inputs
LicenceNone statedfile: MPL-2.0
Last update5 weeks ago24 Sep 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

128 lines of Pine Script v5 from Tradingview Trading Strategy/ATAS_RangeXV.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

ATAS_RangeXV.pine
// This Pine Script™ source code is subject to the terms of the Mozilla Public License 2.0
// https://mozilla.org/MPL/2.0/
// © Range XV Indicator - ATAS Style Range Bar Visualization

//@version=5
indicator("Range XV [ATAS Style]", shorttitle="RangeXV", overlay=true, max_boxes_count=500, max_labels_count=500)

// === INPUTS ===
string GRP1 = "Range Settings"
rangeSize = input.float(10, "Range Size (Points)", minval=0.1, step=0.5, group=GRP1, tooltip="Price range to form one range bar")
volumeFilter = input.float(1.0, "Volume Confirm (x Avg)", minval=0.1, step=0.1, group=GRP1, tooltip="Min volume vs average to confirm bar")
volLookback = input.int(20, "Volume Lookback", minval=5, group=GRP1)

string GRP2 = "Colors"
bullColor = input.color(color.new(color.green, 30), "Bull Range", group=GRP2)
bearColor = input.color(color.new(color.red, 30), "Bear Range", group=GRP2)
neutralColor = input.color(color.new(color.gray, 50), "Developing Range", group=GRP2)
highVolColor = input.color(color.yellow, "High Volume Candle", group=GRP2)

string GRP3 = "Display"
showBoxes = input.bool(true, "Show Range Boxes", group=GRP3)
showSignals = input.bool(true, "Show Breakout Signals", group=GRP3)
showVolumeHighlight = input.bool(true, "Highlight High Volume Candles", group=GRP3)
showTable = input.bool(true, "Show Info Table", group=GRP3)

// === VARIABLES ===
var float rangeHigh = na
var float rangeLow = na
var float rangeOpen = na
var int rangeStartBar = na
var float accumVolume = 0.0
var int rangeCount = 0
var box currentBox = na

// === CALCULATIONS ===
avgVolume = ta.sma(volume, volLookback)
volumeRatio = avgVolume > 0 ? volume / avgVolume : 1.0
isHighVolume = volumeRatio >= volumeFilter

// Initialize on first bar
if na(rangeHigh)
    rangeHigh := high
    rangeLow := low
    rangeOpen := open
    rangeStartBar := bar_index
    accumVolume := volume

// Update current range
rangeHigh := math.max(rangeHigh, high)
rangeLow := math.min(rangeLow, low)
accumVolume := accumVolume + volume
currentRange = rangeHigh - rangeLow

// Check if range complete
rangeComplete = currentRange >= rangeSize and isHighVolume

// Direction
priceChange = close - rangeOpen
direction = priceChange > 0 ? 1 : priceChange < 0 ? -1 : 0

// Range progress percentage
rangeProgress = rangeSize > 0 ? (currentRange / rangeSize) * 100 : 0

// === DRAW CURRENT DEVELOPING RANGE BOX ===
if showBoxes
    box.delete(currentBox)
    boxCol = direction > 0 ? (isHighVolume ? bullColor : neutralColor) : direction < 0 ? (isHighVolume ? bearColor : neutralColor) : neutralColor
    currentBox := box.new(rangeStartBar, rangeHigh, bar_index, rangeLow, border_color=boxCol, bgcolor=color.new(boxCol, 85), border_width=2)

// === RANGE COMPLETION ===
var label sigLabel = na

if rangeComplete
    rangeCount := rangeCount + 1

    // Draw completion signal
    if showSignals
        label.delete(sigLabel)
        if direction > 0
            sigLabel := label.new(bar_index, rangeLow, "▲", style=label.style_label_up, color=bullColor, textcolor=color.white, size=size.small)
        else if direction < 0
            sigLabel := label.new(bar_index, rangeHigh, "▼", style=label.style_label_down, color=bearColor, textcolor=color.white, size=size.small)

    // Reset for new range
    rangeHigh := close
    rangeLow := close
    rangeOpen := close
    rangeStartBar := bar_index
    accumVolume := 0.0

// === HIGHLIGHT HIGH VOLUME CANDLES (ATAS STYLE) ===
barcolor(showVolumeHighlight and volumeRatio > 2.0 ? highVolColor : na)

// === BREAKOUT SIGNALS ===
rangeUp = rangeComplete and direction > 0
rangeDown = rangeComplete and direction < 0

plotshape(showSignals and rangeUp, "Bull Breakout", shape.triangleup, location.belowbar, bullColor, size=size.small)
plotshape(showSignals and rangeDown, "Bear Breakout", shape.triangledown, location.abovebar, bearColor, size=size.small)

// === INFO TABLE ===
var table tbl = table.new(position.top_right, 2, 7, bgcolor=color.new(color.black, 85), border_width=1)

if showTable and barstate.islast
    dirText = direction > 0 ? "BULL ▲" : direction < 0 ? "BEAR ▼" : "NEUTRAL"
    dirCol = direction > 0 ? bullColor : direction < 0 ? bearColor : neutralColor
    volStatus = isHighVolume ? "✓ CONFIRMED" : "○ Waiting"
    volCol = isHighVolume ? color.green : color.orange

    table.cell(tbl, 0, 0, "Range XV", text_color=color.white, text_size=size.small, bgcolor=color.new(color.blue, 60))
    table.cell(tbl, 1, 0, "", bgcolor=color.new(color.blue, 60))
    table.cell(tbl, 0, 1, "Range Size", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 1, str.tostring(rangeSize, "#.##"), text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 0, 2, "Current", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 2, str.tostring(currentRange, "#.##") + " (" + str.tostring(rangeProgress, "#.#") + "%)", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 0, 3, "Direction", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 3, dirText, text_color=dirCol, text_size=size.tiny)
    table.cell(tbl, 0, 4, "Volume", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 4, volStatus, text_color=volCol, text_size=size.tiny)
    table.cell(tbl, 0, 5, "Vol Ratio", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 5, str.tostring(volumeRatio, "#.##") + "x", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 0, 6, "Range Bars", text_color=color.white, text_size=size.tiny)
    table.cell(tbl, 1, 6, str.tostring(rangeCount), text_color=color.white, text_size=size.tiny)

// === ALERTS ===
alertcondition(rangeUp, "Bullish Range", "Range XV: Bullish breakout with volume!")
alertcondition(rangeDown, "Bearish Range", "Range XV: Bearish breakout with volume!")
alertcondition(rangeComplete, "Range Complete", "Range XV: New range bar formed")

Overview

A developing range closes when its high-low span reaches the chosen point size and volume is at least a set multiple of its recent average. A box shows the forming range, a triangle marks the direction when it completes, and unusually heavy-volume candles can be highlighted. An info table is optional. Settings control range size, volume filter, lookback and colours. It builds boxes on top of normal candles rather than replacing them.

Details

Published by

pranay123-stack on GitHub

Code credit

Range XV Indicator - ATAS Style Range Bar Visualization, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Volume, Breakout

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

algo-trading-strategy

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Range Size (Points)float10rangeSize
Volume Confirm (x Avg)float1.0volumeFilter
Volume Lookbackint20volLookback
Bull Rangecolorcolor.new(color.green, 30)bullColor
Bear Rangecolorcolor.new(color.red, 30)bearColor
Developing Rangecolorcolor.new(color.gray, 50)neutralColor
High Volume Candlecolorcolor.yellowhighVolColor
Show Range BoxesbooltrueshowBoxes
Show Breakout SignalsbooltrueshowSignals
Highlight High Volume CandlesbooltrueshowVolumeHighlight
Show Info TablebooltrueshowTable
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

23 stars

Point-Clip Unified Indicator plots breakout and directional labels on the price chart. It scores volume spikes against a volume average, range or opening-range breaks, optional VWAP or session-anchored VWAP, fast and slow EMA trend, and a higher-timeframe EMA

Indicator v6 BreakoutVolume Repaints
Updated 3 weeks ago · Custom licence GitHub repository of Point-Clip Unified Indicator

ORB Multi-Model Indicator

by Mrshahidali420
16 stars

This indicator plots several New York opening-range breakout models on the price chart and can also show a combined confidence-scored signal. Enabled models include classic Crabel, a five-minute scalper, a standard fifteen-minute breakout, and a gold variant,

Indicator v6 BreakoutSessions & time Repaints
Updated 3 months ago · None stated GitHub repository of ORB Multi-Model Indicator
13 stars

This script identifies and visualizes bullish and bearish order blocks on the price chart. It detects low-volatility consolidation ranges followed by breakout moves accompanied by high trading volume. Users can select between Simple, Relative, or Weighted volu

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 6 months ago · MIT GitHub repository of Advanced Order Blocks with Volume

This indicator identifies and plots price compression zones directly on the price chart using multi-module scoring. It measures ATR compression, ADX chop levels, boundary touches, volume dry-up, and historical pivot levels to identify consolidation areas and s

Indicator v6 BreakoutSupport & resistance
Updated 2 days ago · MIT GitHub repository of CoilForge Zones [WavesUnchained]

Nexural ORB

by JasonTeixeira
9 stars

This indicator plots opening range breakout levels across multiple timeframes, including five, fifteen, thirty, and sixty minutes, directly on the price chart. It also displays the session open and overnight high and low levels. The script calculates an openin

Indicator v6 BreakoutSessions & time
Updated 13 days ago · Custom licence GitHub repository of Nexural ORB

5000x Breakout Scanner

by jmragsdale
8 stars

This indicator marks momentum breakouts on the price chart. A signal appears only when the bar makes a new high over the lookback, volume is at least a chosen multiple of the 20-bar average, the percentage change from the prior close meets a minimum, the close

Indicator v5 BreakoutVolume
Updated 7 weeks ago · None stated GitHub repository of 5000x Breakout Scanner

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers