TradingView indicators

Acceleration Bands on TradingView: Formula and Breakout Conditions

Acceleration Bands expand each bar's high and low by a normalized range, then smooth those expanded prices with a simple moving average. A close outside a band describes a breakout condition; a second consecutive close adds confirmation without guaranteeing continuation.

Use the public factor-4 calculation below to compare values, distinguish a wick from a completed close, and define exactly when an alert should fire. Different scripts can use different formulas or filters, so matching the indicator name is insufficient.

Check the formula and worked example

Expand each bar, then smooth

The TC2000 public formula uses a width parameter. At width 1, define H as high, L as low, C as close, and n as the number of bars:

r = (H - L) / (H + L)

Upper = SMA(H × (1 + 4r), n)

Middle = SMA(C, n)

Lower = SMA(L × (1 - 4r), n)

The denominator is H + L, not their average. Using (H + L) / 2 requires changing the multiplier from 4 to 2 to preserve the same result. Compute the transformed price on every bar before averaging. Applying the expansion to already averaged highs and lows generally gives different values.

A reproducible 20-bar example

Assume 20 consecutive bars each have H = 102, L = 98 and C = 100. The ratio is 4 / 200 = 0.02. Every transformed high is 102 × 1.08 = 110.16; every transformed low is 98 × 0.92 = 90.16. Their 20-bar averages are therefore 110.16 and 90.16, while the middle is 100.

The distances from the middle are 10.16 and 9.84. Although descriptions sometimes call Acceleration Bands equidistant, this public high/low calculation is not generally symmetric around the SMA of closes. Its band midpoint here is 100.16. Do not replace the lower line with a reflection of the upper line.

Denominator and initialization boundaries

  • H + L = 0 makes the ratio undefined. A denominator close to zero can magnify small changes. Reject invalid bars explicitly in a custom version; silently substituting zero range changes the method.
  • The intended domain here is positive prices with H ≥ L. For negative-price instruments or synthetic spreads, the ratio can change sign or become unstable. This interpretation does not carry over automatically.
  • Even with positive prices, the lower multiplier becomes negative when 3H > 5L. A negative lower band is a mathematical output, not a tradable support price.
  • With complete data, a 20-bar SMA first has a full window on bar 20. If a custom version rejects a bar, define whether it requires 20 consecutive valid bars before signals resume; skipping missing values is a different policy.

One close, two closes, and a failed breakout

Price Headley's explanation describes two consecutive closes above the upper band and a traditional exit on one close back inside. It also warns that choppy markets can produce false signals. A two-close condition filters out some one-bar excursions but enters later and can still fail.

Use strict comparisons: a long-side outside close means C is greater than that bar's upper band. Equality is a touch. For two-bar confirmation, compare the previous close with the previous upper band and the current close with the current upper band. Do not compare both closes with today's band.

Hypothetical signal comparisons; these are supplied band values, separate from the formula example.
CaseBar ABar BResult after B closes
Wick onlyHigh 103; close 101.8; upper 102Close 101.7; upper 102.1No outside close; no two-close confirmation
One-bar excursionClose 102.4; upper 102Close 101.8; upper 102.2One-close rule fires at A; two-close rule never confirms
Two closes, then failureClose 102.4; upper 102Close 102.6; upper 102.2Confirms at B; a later close 101.9 below upper 102.3 ends the run
Exact touchClose 102; upper 102Close 102.4; upper 102.2Only B qualifies; equality on A is not outside

For a mirrored short-side experiment, require each close below its own lower band and define the return-above rule separately. If an alert should fire once per breakout, trigger only when the consecutive-close count first reaches two. A condition that stays true on bars three and four can otherwise repeat the alert.

The open bar changes its high, low, close and band values. Evaluate close-based conditions after the bar completes and align the alert frequency with that choice. TradingView explains this realtime behavior. The next executable order price may differ from the signal close because of gaps, spread and slippage.

Compare AB, Bollinger and Keltner on the same window

Use the same 20 hypothetical bars above, with the previous close also 100. For the Keltner comparison, assume EMA and ATR have already stabilized on identical earlier bars. Set both lengths to 20 and the ATR multiplier to 2. This isolates how the width measures differ.

Same OHLC input, different calculations. All values are hypothetical price units.
Indicator and settingsWidth inputMiddleUpper / lower
Acceleration Bands, n = 20, factor 4(102 - 98) / (102 + 98) = 0.02100110.16 / 90.16
Bollinger, SMA(20), 2 standard deviationsAll closes are 100, so standard deviation = 0100100 / 100
Keltner, EMA(20), 2 × ATR(20)True range = 4; stabilized ATR = 4100108 / 92

Bollinger Bands measure dispersion of the selected source; with close as the source, intrabar movement alone need not produce dispersion. An ATR-based Keltner Channel measures ranges around a moving average. Acceleration Bands average transformed highs and lows.

A gap exposes another difference: with previous close 100, H = 111 and L = 109, the bar range is 2 but true range is max(2, 11, 9) = 11. The AB range ratio is 2 / 220, about 0.00909; it has no previous-close term. Its levels still move with H and L, but it does not directly measure the gap the way true range does. None of these formulas establishes a universal speed or profitability ranking.

Read the plotting example before adding signals

This existing example uses the public factor-4 calculation and a fixed 20-bar length. It draws three plots and a fill. It has no alert conditions, strategy orders, editable length input or explicit denominator guard. Use positive-price data with complete bars for formula comparison; do not treat the plot as a complete trading system.

Pine Script v6 plotting example
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Pineify

//@version=6
indicator(title="Acceleration Bands", overlay=true, max_labels_count=500)

p_ta_ab(simple int length) =>
    upper = ta.sma(high * (1 + 4 * (high - low) / (high + low)), length)
    middle = ta.sma(close, length)
    lower = ta.sma(low * (1 - 4 * (high - low) / (high + low)), length)
    [upper, middle, lower]

[p_ind_1_upper, p_ind_1_middle, p_ind_1_lower] = p_ta_ab(20)

p_ind_1_upper_plot = plot(p_ind_1_upper, "AB - Upper", color.rgb(120, 123, 134, 0), 1)
plot(p_ind_1_middle, "AB - Middle", color.rgb(255, 152, 0, 0), 1)
p_ind_1_lower_plot = plot(p_ind_1_lower, "AB - Lower", color.rgb(120, 123, 134, 0), 1)
fill(p_ind_1_upper_plot, p_ind_1_lower_plot, title = "AB - Band", color=color.rgb(33, 150, 243, 95))

In TradingView, open Pine Editor, paste the example and add it to a standard candlestick chart. Compare upper, middle and lower values in the Data Window on completed bars. Match symbol, timeframe, session, adjustment settings, length, factor and any display offset before comparing with another script. Similar-looking bands do not prove matching calculations.

Turn a verified rule into a Pine script

Pineify's Pine Script AI Coding Agent can create and edit Pine code from a written specification. Supply the public formula, valid-price assumptions, warm-up behavior and closed-bar rules together. Review the generated source and compare its numerical outputs in TradingView before adding alerts. A syntax check cannot establish signal quality or reproduce a proprietary indicator's hidden logic.

Example request: Build an Acceleration Bands indicator using the public factor-4 high/low formula with a 20-bar SMA. Reject nonpositive prices and invalid denominators, require a complete valid window, and expose the length as an input. Add separate markers for the first outside close and the second consecutive outside close. Evaluate only completed bars and emit the confirmation alert once per run. Show the band values for comparison.
Build an Acceleration Bands script

Product access and usage limits depend on your plan. These examples are educational, not investment advice. No performance is claimed. Backtests need explicit exits, fills, costs and position sizing, and historical results do not guarantee future returns.

Acceleration Bands FAQ

For each bar, calculate r = (high - low) / (high + low). Average high × (1 + 4r) for the upper band and low × (1 - 4r) for the lower band over the chosen length. The middle line is the simple average of closes. This page uses the public factor-4 formula and a 20-bar example.

One close satisfies a one-close breakout rule. Price Headley describes two consecutive closes above the upper band as his long signal and one close back inside as a traditional exit. Each close must be compared with its own bar's band. Two closes delay confirmation and still allow failed breakouts.

The public high/low formula shown here does not guarantee equal distances from the SMA of closes. For repeated bars with high 102, low 98 and close 100, the upper band is 110.16, the lower band is 90.16 and the middle line is 100. Check the formula of the particular implementation you use.

The range ratio is undefined. Near zero it can become unstable; negative-price and synthetic spread series need separate handling. The original plotting example below has no explicit denominator guard and should not be used for signals on those inputs. A custom version should reject invalid bars and state its warm-up policy.

No. It plots three lines and a fill with a fixed 20-bar length. It does not include inputs, confirmed-close filters, alerts, entries or exits. Add and test those rules separately before using the bands in a trading workflow.

Sources and related indicators

Sources reviewed October 17, 2026. Numeric examples are synthetic calculations, not measured trading results.