TradingView indicators

Chaikin Volatility indicator: measure range expansion

Chaikin Volatility is the percentage change in an exponential moving average of each bar's high-low range. A reading of +25% means that smoothed range is 25% larger than its lookback value. It does not tell you whether price will rise or fall.

Range EMA: 2.00 → 2.50
CV = 100 × (2.50 - 2.00) / 2.00 = +25%

Illustrative calculation, in price units. This is a change in range, not a 25% price return.

Calculate the range EMA, then its rate of change

  1. For each bar, compute R = high - low. Do not substitute close-to-close returns or true range.
  2. Smooth R with an EMA of length N: E[t] = α × R[t] + (1 - α) × E[t-1], where α = 2 / (N + 1).
  3. Compare E[t] with E[t-M], the EMA from M bars earlier: CV[t] = 100 × (E[t] - E[t-M]) / E[t-M]. The baseline must be positive and available.

The EMA period N and ROC lookback M are separate inputs. Fidelity's formula describes 10 for both. The code below uses 10 and 12, matching Pineify's current indicator configuration. These are starting values, not evidence of an optimal timeframe or trading edge.

A five-bar calculation you can check

Use N = 3, so α = 0.5, and M = 2. Assume the EMA at bar 0 is 2.00; this is a stated starting value, not a claim about every platform's initialization. All prices are synthetic.

Three-period EMA with a two-bar ROC lookback
BarHighLowRangeRange EMAEMA 2 bars agoCV
010210022.00 (assumed starting EMA)UnavailableUnavailable
110510140.5 × 4 + 0.5 × 2 = 3.00UnavailableUnavailable
210810260.5 × 6 + 0.5 × 3 = 4.502.00+125.00%
310710340.5 × 4 + 0.5 × 4.5 = 4.253.00+41.67%
410510320.5 × 2 + 0.5 × 4.25 = 3.1254.50-30.56%

At bar 2: 100 × (4.50 - 2.00) / 2.00 = +125%. At bar 3 the EMA falls from 4.50 to 4.25, yet CV remains positive because 4.25 still exceeds its two-bar baseline of 3.00. A positive CV therefore does not mean the range increased on the latest bar.

At bar 4: 100 × (3.125 - 4.50) / 4.50 = -30.56%, rounded. Keep full precision during the calculation and round only the displayed result.

Read the percentage with its baseline

Zero means unchanged relative to M bars ago. An EMA holding at 8.00 and one holding at 0.20 both give CV = 0%. Neither the sign nor a zero crossing establishes an absolute low-volatility squeeze. Read the range EMA alongside CV.

With valid nonnegative ranges and a positive baseline, CV cannot be below -100%; it has no fixed upper bound. A rise from 0.001 to 0.011 gives +1,000%, despite an absolute change of only 0.010 price units. Check tick size, trading activity and the raw range before interpreting such a spike.

Zero and near-zero denominators

A zero baseline makes the percentage undefined. The example returns na instead of replacing the denominator with 1 or returning a misleading zero. Its minimum-baseline input is in price units: setting it above zero suppresses small baselines, but also changes which observations remain visible. Choose and document a floor appropriate to the instrument; one fixed floor does not suit every market.

A gap that Chaikin Volatility can miss

Assume the previous close is 100 and the range EMA and lookback baseline are both 2. The next bar gaps up and trades between 110 and 112. Its high-low range is still 2, so the range EMA stays at 2 and CV remains 0%.

High-low range = 112 - 110 = 2
True range = max(2, |112 - 100|, |110 - 100|) = 12

ATR averages true range, so it incorporates that gap. With a prior 14-period RMA ATR of 2, the next ATR would be (13 × 2 + 12) / 14 = 2.7143. That is the smoothed ATR, not the raw true range of 12. A gap can affect CV if it also changes the bar's high-low range, but gap size itself is absent from CV's input.

Keep price direction separate

Rising and falling prices can produce identical high-low ranges and identical CV readings. Chaikin Oscillator and Chaikin Money Flow use volume-based calculations; sharing Chaikin's name does not make them interchangeable with this range oscillator.

Pine Script v6 with a denominator check

Paste this indicator into TradingView's Pine Editor, save it and add it to the chart. It plots CV in a separate pane and exposes the current and baseline range EMAs in the Data Window. The first M bars have no comparison value. Allow additional history for EMA initialization when comparing charts.

Pine Script v6
//@version=6
indicator("Chaikin Volatility: range change", shorttitle="CV", overlay=false, precision=2)

emaLength = input.int(10, "Range EMA length", minval=1)
rocLength = input.int(12, "ROC lookback bars", minval=1)
minimumBase = input.float(0.0, "Minimum baseline range (price units)", minval=0.0)

rangeEma = ta.ema(high - low, emaLength)
baseline = rangeEma[rocLength]
validBase = not na(baseline) and baseline > minimumBase
cv = validBase ? 100.0 * (rangeEma - baseline) / baseline : na

plot(cv, "Chaikin Volatility (%)", color=color.blue, linewidth=2, style=plot.style_linebr)
hline(0, "Unchanged range", color=color.gray)
plot(rangeEma, "Range EMA (price units)", display=display.data_window)
plot(baseline, "Baseline EMA (price units)", display=display.data_window)

crossedAboveZero = ta.crossover(cv, 0)
confirmedExpansion = barstate.isconfirmed and crossedAboveZero
alertcondition(confirmedExpansion, "Confirmed CV cross above zero", "Smoothed range crossed above its lookback baseline. Direction requires a separate rule.")

Set EMA length to 3 and ROC lookback to 2 to match the worked example's parameters; your chart prices will differ from the synthetic table. With the minimum baseline at 0, the script excludes zero but still displays small positive baselines. Blank sections indicate unavailable or excluded data.

The plot can move during the open bar. The alert condition requires a confirmed close and a crossover from at or below zero to above zero. Create an alert using that condition and choose Once Per Bar Close. A confirmed expansion alert reports a range comparison; it does not submit orders or identify a trade direction.

Use CV as a filter with an independent entry rule

  1. Define a volatility state, such as a valid CV above zero. This state can persist for multiple bars; a zero-line crossover is a one-bar event.
  2. Define direction separately, for example a close above the highest high of the prior 20 completed bars for a long breakout. Exclude the current bar from that reference.
  3. Specify the exit, position size, fees and slippage before backtesting. Compare the same strategy with and without the filter on data outside the parameter-selection period.

This is a rule specification to test, not a validated profitable strategy. Changing sessions, chart types or timeframes changes the range input. Use standard candles and consistent session settings for a reproducible comparison.

Chaikin Volatility questions

Sources and calculation scope

Sources checked October 17, 2026. The numeric examples are synthetic arithmetic illustrations, not market observations or backtest results.

For the size of gap-aware movement, read the ATR guide. To compare range change with price change, see the Momentum guide.

Add the range filter to your Pine strategy

Pineify's Pine Script AI Coding Agent can help write or edit the code from explicit rules. Supply both CV lengths, your minimum baseline, a separate direction rule and the exit logic. Review the resulting script and compare it on TradingView before using it.

Add a Chaikin Volatility filter using EMA 10 and ROC 12 to my strategy. Exclude unavailable and zero baselines. Require CV above zero at bar close, keep my existing entry direction and exits, and expose the inputs for testing.
Open Pine Script AI Coding Agent

Educational information, not investment advice. Syntax validation does not establish strategy profitability. Trading can result in losses.