Indicator · Pine Script v6 · On the chart

Jurik Volatility Bands (JBANDS)

by mihakralj

This indicator calculates adaptive Jurik Volatility Bands and plots an upper band, a lower band, and a filled channel directly on the price chart.

View on GitHub

GitHub stars47on the repository
Pine versionv6current
Lines of code51
Settings2inputs
LicenceMIT
Last update8 months ago28 Feb 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

51 lines of Pine Script v6 from indicators/channels/jbands.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

jbands.pine
// The MIT License (MIT)
// © mihakralj
//@version=6
indicator("Jurik Volatility Bands (JBANDS)", "JBANDS", overlay=true)

//@function Calculates JBANDS using adaptive techniques to adjust width to market volatility
//@param source Series to calculate Jvolty from
//@param period Number of bars used in the calculation
//@returns JBANDS volatility bands
//@optimized Uses adaptive volatility weighting with O(1) complexity per bar
jbands(series float source, simple int period) =>
    var simple float LEN1 = math.max((math.log(math.sqrt(0.5 * (period - 1))) / math.log(2.0)) + 2.0, 0.0)
    var simple float POW1 = math.max(LEN1 - 2.0, 0.5)
    var simple float LEN2 = math.sqrt(0.5 * (period - 1)) * LEN1
    var simple float AVG_VOLTY_ALPHA = 2.0 / (math.max(4.0 * period, 65.0) + 1.0)
    var simple float DIV = 1.0 / (10.0 + 10.0 * (math.min(math.max(period - 10, 0), 100) / 100.0))
    var float upperBand = nz(source)
    var float lowerBand = nz(source)
    var float vSum = 0.0
    var float avgVolty = 0.0
    if na(source)
        na
    else
        float del1 = (low + high) * 0.5 - upperBand
        float del2 = (low + high) * 0.5 - lowerBand
        float volty = math.max(math.abs(del1), math.abs(del2))
        float past_volty = na(volty[10]) ? 0.0 : volty[10]
        vSum := vSum + (volty - past_volty) * DIV
        avgVolty := na(avgVolty) ? vSum : avgVolty + AVG_VOLTY_ALPHA * (vSum - avgVolty)
        float rvolty = 1.0
        if avgVolty > 0.0
            rvolty := volty / avgVolty
            rvolty := math.min(math.max(rvolty, 1.0), math.pow(LEN1, 1.0 / POW1))
        float Kv = math.pow(LEN2 / (LEN2 + 1.0), math.sqrt(math.pow(rvolty, POW1)))
        upperBand := del1 > 0.0 ? high : high - Kv * del1
        lowerBand := del2 < 0.0 ? low : low - Kv * del2
        [upperBand, lowerBand]

// ---------- Main loop ----------

// Inputs
i_period = input.int(10, "Period", minval=1)
i_source = input.source(close, "Source")

// Calculation
[upperBand, lowerBand] = jbands(i_source, i_period)

// Plot
p1 = plot(upperBand, "Upper", color=color.yellow, linewidth=2)
p2 = plot(lowerBand, "Lower", color=color.yellow, linewidth=2)
fill(p1, p2, color=color.new(color.blue, 90), title="Band Fill")

Overview

Jurik Volatility Bands (JBANDS) dynamically adjusts band width according to prevailing market volatility using an adaptive volatility weighting algorithm. User configurable settings allow traders to modify the calculation period and the price source. The script functions purely as a visual channel overlay without generating automated trading signals, directional alerts, or execution rules.

Details

Published by

mihakralj on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

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.

Topics

pinescriptpinescript-indicatorstechnical-analysistradingview-indicators

Settings

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

SettingTypeDefaultVariable
Periodint10i_period
Sourcesourceclosei_source
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

Chandelier Exit

by everget
948 stars

This indicator plots an ATR-based Chandelier Exit trailing stop on the price chart. It tracks a long stop under recent highs and a short stop above recent lows, then switches direction when price crosses the opposite stop. Buy and sell labels mark those flips.

Indicator v6 Volatility & bandsTrend Repaints
Updated 10 days ago · GPL-3.0 GitHub repository of Chandelier Exit

ICT Liquidity Void Fill

by ArunKBhaskar
575 stars

This overlay indicator marks ICT liquidity void fills on the price chart and can show long and short signals. It places a Fibonacci level inside a displacement candle, defaulting to the midpoint, and draws lines in a chosen style. Optional filters limit the fi

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Liquidity Void Fill

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 calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos

Indicator v5 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of ATR Trailing Stoploss

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