Indicator · Pine Script v6 · On the chart

Zen ABR Range Bands

by Zen-Tim

The Zen ABR Range Bands indicator calculates an 8-bar average range from high-low differences and an exponential moving average of close prices.

View on GitHub

GitHub stars29on the repository
Pine versionv6current
Lines of code53
Settings12inputs
LicenceMIT
Last update2 weeks ago14 Oct 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

53 lines of Pine Script v6 from indicators/Zen-ABR-Range-Bands/zen-abr-range-bands-v1.0.txt, published under MIT. Keep the author's credit and licence lines when you reuse it.

zen-abr-range-bands-v1.0.txt
//@version=6
indicator("Zen ABR Range Bands v1.0", overlay=true)

// ============================================================
// INPUTS
// ============================================================

// --- Moving Average ---
showEMA  = input.bool(true, "Show EMA", group="Moving Average")
emaLen   = input.int(20, "EMA Length", minval=1, group="Moving Average")
emaColor = input.color(color.new(#1A1A1A, 50), "EMA Color", group="Moving Average")

// --- ABR Bands (8-bar ABR, multiplied 1x / 2x / 3x / 4x) ---
show1x = input.bool(true,  "Show 1x ABR Band", group="ABR Bands")
col1x  = input.color(color.new(#2B2B2B, 50), "1x ABR Color", group="ABR Bands")

show2x = input.bool(false, "Show 2x ABR Band", group="ABR Bands")
col2x  = input.color(color.new(#404040, 50), "2x ABR Color", group="ABR Bands")

show3x = input.bool(false, "Show 3x ABR Band", group="ABR Bands")
col3x  = input.color(color.new(#595959, 50), "3x ABR Color", group="ABR Bands")

show4x = input.bool(false, "Show 4x ABR Band", group="ABR Bands")
col4x  = input.color(color.new(#737373, 50), "4x ABR Color", group="ABR Bands")

lineWidth = input.int(1, "Band Line Width", minval=1, maxval=4, group="ABR Bands")

// ============================================================
// CALCULATIONS
// ============================================================

emaVal = ta.ema(close, emaLen)

barRange = high - low
abr8 = ta.sma(barRange, 8)   // ABR lookback fixed at 8 — sacrosanct, never change

// ============================================================
// PLOTS
// ============================================================

plot(showEMA ? emaVal : na, title="EMA", color=emaColor, linewidth=2)

plot(show1x ? emaVal + abr8 * 1 : na, title="1x ABR Upper", color=col1x, linewidth=lineWidth)
plot(show1x ? emaVal - abr8 * 1 : na, title="1x ABR Lower", color=col1x, linewidth=lineWidth)

plot(show2x ? emaVal + abr8 * 2 : na, title="2x ABR Upper", color=col2x, linewidth=lineWidth)
plot(show2x ? emaVal - abr8 * 2 : na, title="2x ABR Lower", color=col2x, linewidth=lineWidth)

plot(show3x ? emaVal + abr8 * 3 : na, title="3x ABR Upper", color=col3x, linewidth=lineWidth)
plot(show3x ? emaVal - abr8 * 3 : na, title="3x ABR Lower", color=col3x, linewidth=lineWidth)

plot(show4x ? emaVal + abr8 * 4 : na, title="4x ABR Upper", color=col4x, linewidth=lineWidth)
plot(show4x ? emaVal - abr8 * 4 : na, title="4x ABR Lower", color=col4x, linewidth=lineWidth)

Overview

Zen ABR Range Bands plots the EMA on the price chart along with optional bands at multiples of the ABR (1x, 2x, 3x, 4x) centered on the EMA. Users enable or disable individual bands and customize their colors and line widths via inputs. The main settings adjust the EMA length, colors for each band level, and overall band thickness. It draws all elements directly on the price chart as visual range and volatility reference lines with no entry or exit rules.

Details

Published by

Zen-Tim on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Moving averages, Volatility & bands

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.

Settings

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

SettingTypeDefaultVariable
Show EMAbooltrueshowEMA
EMA Lengthint20emaLen
EMA Colorcolorcolor.new(#1A1A1A, 50)emaColor
Show 1x ABR Bandbooltrueshow1x
1x ABR Colorcolorcolor.new(#2B2B2B, 50)col1x
Show 2x ABR Bandboolfalseshow2x
2x ABR Colorcolorcolor.new(#404040, 50)col2x
Show 3x ABR Bandboolfalseshow3x
3x ABR Colorcolorcolor.new(#595959, 50)col3x
Show 4x ABR Bandboolfalseshow4x
4x ABR Colorcolorcolor.new(#737373, 50)col4x
Band Line Widthint1lineWidth
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

Hampel Filter

by everget
948 stars

The Hampel Filter indicator identifies and filters out price outliers to smooth price data directly on the main chart. It calculates the rolling median and Median Absolute Deviation (MAD) of the chosen source series over a specified length. When a data point e

Indicator v4 Moving averagesVolatility & bands
Updated 10 days ago · GPL-3.0 GitHub repository of Hampel Filter

This overlay indicator plots a Supertrend from an ATR length and factor, four exponential moving averages, and a selectable VWAP or TWAP taken from a chosen timeframe on the price chart. It also shows MACD and stochastic with adjustable lengths, smoothing, ver

Indicator v5 Oscillators & momentumMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup: Vijay Thakare Option Buying Scalping Setup

This indicator plots trade entry and exit signals on the price chart by combining Bollinger Bands with optional filter conditions. It calculates standard Bollinger Bands along with RSI, Aroon, and moving average filters. Reversal signals trigger when price bre

Indicator v4 Volatility & bandsOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Bollinger Bands Winner IND [Alorse]
318 stars

This indicator plots four customizable moving averages directly on the main price chart using default lengths of 3, 8, 21, and 50 periods. It fills the space between adjacent averages in green or maroon depending on trend alignment. Additionally, it computes B

Indicator v5 Moving averagesTrend
Updated 2 months ago · MIT GitHub repository of Multiple Moving Averages

NVDA Trend Ribbon

by longsurf-ai
277 stars

This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart. It compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the thre

Indicator v6 TrendMoving averages
Updated yesterday · MIT GitHub repository of NVDA Trend Ribbon

Algo AVT

by ricardosantos79
261 stars

This indicator calculates an outlier-filtered moving average based on statistical filtering concepts. It stores close prices in a rolling array over a user-defined length, calculates the mean and standard deviation, and excludes values falling within a specifi

Indicator v4 Moving averagesVolatility & bands
Updated 4 years ago · None stated GitHub repository of Algo AVT

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