TradingView indicator guides

STARC Bands: ATR channels and risk context

STARC Bands place a moving-average basis between two bands whose distance is a multiple of Average True Range. They show price location relative to recent volatility. A touch or close outside the channel does not, by itself, predict a reversal.

This TradingView example fixes the basis at an SMA and makes the ATR smoothing explicit: SMA or Wilder RMA. Start with the formula and worked example, then copy the Pine Script to compare your chart.

Example configuration

SMA(close, 6) ± 2 × SMA(true range, 15)

Illustrative inputs. Changing the ATR average changes the channel.

View the Pine Script example

STARC Bands formula and version choices

The SMA formulation uses a separate basis length and true-range averaging length. Sierra Chart documents both the SMA-based bands and configurable averaging methods. Its implementation also allows separate upper and lower multipliers; this example uses one multiplier for symmetric distances.

TR = max(high - low, |high - previous close|, |low - previous close|)
Basis = SMA(source, basis length)
Range average = SMA(TR, ATR length) or Wilder RMA(TR, ATR length)
Upper = Basis + multiplier × Range average
Lower = Basis - multiplier × Range average

With SMA smoothing, each of the last n true ranges has weight 1/n. Once seeded, Wilder RMA updates as (previous average × (n - 1) + current TR) / n. An old spike leaves an SMA window at once; its influence decays gradually under RMA. TradingView's ATR defaults to RMA, so replacing a simple range average with ta.atr changes the result.

The selectable source affects only the SMA basis. True range must still reference the previous close, even if the basis uses hl2. Early bars need enough observations for the averages. Match chart sessions and adjusted-price settings before comparing two scripts.

Sources: Sierra Chart STARC and TradingView ATR.

A calculation you can reproduce

Use a short 3-bar basis and 3-bar range average for arithmetic clarity. These synthetic prices are an example, not market data. The close immediately before bar A is 100.

Synthetic OHLC inputs in price units
BarHighLowCloseTrue range
A102991013
B1041001034
C1081051065
D1071051062

Bar C has a high-low range of 3, but TR is max(3, |108 - 103|, |105 - 103|) = 5 because it gaps above the previous close. At C, the SMA basis is (101 + 103 + 106) / 3 = 103.3333. The range average is (3 + 4 + 5) / 3 = 4. With a multiplier of 2, the upper band is 111.3333 and the lower band is 95.3333.

Seed both range averages at C with 4. At D, the SMA range is (4 + 5 + 2) / 3 = 3.6667; Wilder RMA is (4 × 2 + 2) / 3 = 3.3333. The basis is now (103 + 106 + 106) / 3 = 105. The SMA bands are 112.3333 and 97.6667; the RMA bands are 111.6667 and 98.3333. The method alone changes each boundary by about 0.6667. Values are rounded only for display.

STARC Bands Pine Script v6

Paste this indicator into TradingView's Pine Editor and add it to a standard candle chart. Use the indicator settings to change lengths, multiplier, source, and smoothing. It plots the channel and marks confirmed closes outside it. It contains no entry, exit, position sizing, or performance backtest.

Pine Script v6
//@version=6
indicator("STARC Bands: explicit ATR smoothing", overlay=true)

source = input.source(close, "Basis source")
basisLength = input.int(6, "SMA basis length", minval=1)
atrLength = input.int(15, "True range average length", minval=1)
multiplier = input.float(2.0, "ATR multiplier", minval=0.1, step=0.1)
smoothing = input.string("SMA", "ATR smoothing", options=["SMA", "Wilder RMA"])

// True range always uses the previous close, independent of basis source.
trueRange = ta.tr(true)
smaRange = ta.sma(trueRange, atrLength)
wilderRange = ta.atr(atrLength)
rangeAverage = smoothing == "SMA" ? smaRange : wilderRange
basis = ta.sma(source, basisLength)
upper = basis + multiplier * rangeAverage
lower = basis - multiplier * rangeAverage

plot(basis, "SMA basis", color=color.blue, linewidth=2)
upperPlot = plot(upper, "Upper band", color=color.red)
lowerPlot = plot(lower, "Lower band", color=color.green)
fill(upperPlot, lowerPlot, color=color.new(color.blue, 93), title="Channel")

// These mark confirmed location states, not trade orders.
closedAbove = barstate.isconfirmed and close > upper
closedBelow = barstate.isconfirmed and close < lower
plotshape(closedAbove, title="Close above upper", style=shape.circle, location=location.abovebar, color=color.red, size=size.tiny)
plotshape(closedBelow, title="Close below lower", style=shape.circle, location=location.belowbar, color=color.green, size=size.tiny)
alertcondition(closedAbove, title="STARC close above upper", message="Confirmed close above the upper STARC band.")
alertcondition(closedBelow, title="STARC close below lower", message="Confirmed close below the lower STARC band.")

Copy the script into the TradingView Pine Editor.

The circles mark every qualifying closed bar, including consecutive bars outside the same band. An upper circle tests close > upper; an intrabar high that touches the upper band but closes inside is a different event. Create an alert from either named condition and choose Once Per Bar Close. The live bands can move before the bar closes.

STARC vs Keltner, Bollinger, and percentage envelopes

Channel versionBasisDistance from basis
STARC in this exampleSMA of sourceMultiplier × SMA or RMA of true range
Common modern KeltnerEMA of sourceMultiplier × ATR; verify its smoothing
Traditional BollingerSMA of sourceMultiplier × standard deviation of source
Percentage envelopeSelected moving averageFixed percentage of the basis

Keltner and STARC can overlap mathematically when their inputs and averaging methods match. Compare the actual implementation before attributing a difference to the name. ATR measures ranges and gaps; standard deviation measures dispersion around an average. Neither is always wider or faster. A fixed-percentage envelope does not measure recent range independently of its basis.

Two ATRs is a price distance, not a confidence interval. John Bollinger also cautions against assuming a normal distribution or a fixed containment rate for Bollinger Bands. A channel cannot supply a probability of reversal from its width alone.

Sources: TradingView Keltner Channels and Bollinger Band rules.

Band conditions need a failure rule

Suppose a channel has basis 100, ATR 2, and multiplier 2. The lower band is 96. A close at 95.5 is outside. On the next bar, suppose the basis falls to 98 and ATR rises to 3: the lower band moves to 92. A close at 93 is now inside, despite price falling another 2.5. Re-entry can occur because the band moved, not because price recovered. This is a hypothetical state example, not a claimed market outcome.

  • Separate a wick touch, an outside close, and a return inside. Decide whether each comparison uses the current band or a level frozen on the previous bar.
  • In a sustained decline, repeated lower-band events can accompany further losses. A falling basis or repeated outside closes should invalidate any assumption that a touch alone identifies a bottom.
  • When ATR expands after a gap, the channel can widen while price keeps moving against a position. A moving band is not a fixed loss limit, and a stop can fill beyond its level.
  • For a trading test, predefine the trend filter, entry confirmation, stop, maximum holding period, and position size. Include fees, spread, slippage, and an untouched test period. Additional filters do not establish an edge by themselves.

This guide is educational, not investment advice. These examples demonstrate calculations and conditions; they provide no evidence of profitability, reversal frequency, or suitable settings for your market.

Turn a defined STARC condition into code

Pineify's Pine Script AI Coding Agent can help create or modify a script from your stated rules. Specify the smoothing and event definition before requesting an extension. For example:

Build a Pine v6 STARC overlay with SMA(close, 6), SMA of true range over 15 bars, and multiplier 2. Keep true range based on previous close. Mark confirmed closes below the lower band separately from the first return inside. Add alerts, but no trade orders. Explain which conditions use the current bar's bands, and check syntax.

Review the output against the arithmetic above and inspect signals on your chart. Request syntax checking explicitly. A successful syntax check does not validate a trading rule or its returns.

Explore the Pine Script AI Coding Agent

STARC Bands FAQ

Sources and related guides

Sources checked October 17, 2026. Calculations and hypothetical cases on this page are illustrative.