Expected Move Bands: a free Pine Script for TradingView
Paste this script into TradingView and your chart shows the one standard deviation move that implied volatility prices for the next session and for the rest of the week. It is free and open source under the Mozilla Public License 2.0.
Last updated 29 Nov 2026
Jump to the script and the copy button.
What it draws
- Day bands (blue): the next session's one standard deviation move, measured from the previous daily close and held through the day.
- Week bands (orange): the move for a five-day week, measured from the last close before the week began.
- Forward lines (dashed): the next day and next week ranges from the latest close, drawn five bars to the right of the last bar.
- Optional 2 standard deviation bands, fainter, for both day and week.
- A small table, top right: the volatility it used and where from, the close it measured from, the next day and next week ranges, and the move in percent.
The formula
move = price × IV × sqrt(days / 252)
IV is annual implied volatility as a decimal, 252 is the trading days in a year, and days is 1 for the day bands and 5 for the week bands. With SPY at 600 and VIX at 16, the next day move is 600 × 0.16 × sqrt(1/252), about 6.05, so the day bands sit near 594 and 606. The week move is about 13.52.
The volatility source
With IV source on Auto, the script picks the volatility index that matches the symbol. You can also force Manual IV or Realized only in the settings.
| Source | Used for | What it reads |
|---|---|---|
| VIX | SPY, SPX, VOO, IVV and the ES and MES futures | Implied volatility, from the index |
| VXN | QQQ, NDX and the NQ and MNQ futures | Implied volatility, from the index |
| RVX | IWM, RUT and the RTY and M2K futures | Implied volatility, from the index |
| VXD | DIA, DJI and the YM and MYM futures | Implied volatility, from the index |
| Manual IV | Any other symbol, when you type an IV in Manual IV (%) | The implied volatility you enter, for example from the option chain |
| HV fallback | Any other symbol with Manual IV left at 0, or any symbol with IV source set to Realized only | Realized volatility of the last 20 daily closes (change it in Realized vol lookback), marked HV in the table |
A volatility index is priced from options on the index, so on these symbols the bands are the move the options market prices. Realized volatility is the stock's own past moves, so on HV the bands show how far it has been moving, not what its options price. For a single stock, type its IV from the option chain into Manual IV to get the options market's range.
How to add it in 3 steps
- Open the Pine Editor. On a TradingView chart, open the Pine Editor tab at the bottom of the screen.
- Paste. Copy the script below, select everything in the editor and paste over it.
- Add to chart. Press Add to chart. Save it to keep it in your indicators.
It runs on any timeframe. The bands read daily and weekly closes, so they look best on intraday and daily charts.
The script
Pine Script v6, Mozilla Public License 2.0.
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © OheyRingMaster
//@version=6
indicator("Expected Move Bands (implied volatility)", shorttitle = "EM Bands", overlay = true, max_lines_count = 10, max_labels_count = 40)
// ── What it does ─────────────────────────────────────────────────────────────
// Draws the one standard deviation move that implied volatility prices, measured
// from the last close, for the next session and for the rest of the week.
// move = close × IV × sqrt(trading days / 252)
// For the big index funds the IV comes from the matching CBOE volatility index.
// For anything else you can type the IV yourself, or let it fall back to the
// realized volatility of recent closes (marked "HV" so you know which it is).
grpSrc = "Volatility source"
mode = input.string("Auto", "IV source", options = ["Auto", "Manual IV", "Realized only"], group = grpSrc,
tooltip = "Auto: CBOE index for SPX/SPY/ES (VIX), NDX/QQQ/NQ (VXN), RUT/IWM/RTY (RVX), DJI/DIA/YM (VXD); others use Manual IV if set, else realized.")
manIV = input.float(0.0, "Manual IV (%)", minval = 0, step = 0.5, group = grpSrc, tooltip = "Annualized implied volatility, e.g. 45 for 45%. 0 = not set.")
hvLen = input.int(20, "Realized vol lookback (days)", minval = 5, group = grpSrc)
grpShow = "Bands"
showD = input.bool(true, "Next session (1 day)", group = grpShow)
showW = input.bool(true, "Rest of week", group = grpShow)
show2 = input.bool(false, "Also draw 2 standard deviations", group = grpShow)
colD = input.color(color.new(#2962FF, 0), "Day color", group = grpShow)
colW = input.color(color.new(#FF6D00, 0), "Week color", group = grpShow)
showTbl = input.bool(true, "Show table", group = grpShow)
// ── Pick the volatility index for the symbol ─────────────────────────────────
root = syminfo.root
tick = syminfo.ticker
f_volIndex() =>
string s = na
if tick == "SPY" or tick == "SPX" or root == "ES" or root == "MES" or tick == "VOO" or tick == "IVV"
s := "CBOE:VIX"
else if tick == "QQQ" or tick == "NDX" or root == "NQ" or root == "MNQ"
s := "CBOE:VXN"
else if tick == "IWM" or tick == "RUT" or root == "RTY" or root == "M2K"
s := "CBOE:RVX"
else if tick == "DIA" or tick == "DJI" or root == "YM" or root == "MYM"
s := "CBOE:VXD"
s
volSym = f_volIndex()
hasIdx = not na(volSym)
idxIV = request.security(hasIdx ? volSym : "CBOE:VIX", "D", close[1], lookahead = barmerge.lookahead_on)
idxNow = request.security(hasIdx ? volSym : "CBOE:VIX", "D", close)
// Realized volatility of daily closes, annualized, as a percent
hvDay = request.security(syminfo.tickerid, "D", ta.stdev(math.log(close / close[1]), hvLen), lookahead = barmerge.lookahead_off)
hv = hvDay * math.sqrt(252) * 100
float iv = na
string ivLabel = ""
if mode == "Realized only"
iv := hv
ivLabel := "HV " + str.tostring(hvLen) + "d"
else if mode == "Manual IV" or (mode == "Auto" and not hasIdx)
if manIV > 0
iv := manIV
ivLabel := "IV (manual)"
else
iv := hv
ivLabel := "HV " + str.tostring(hvLen) + "d"
else
iv := idxIV
ivLabel := str.replace(volSym, "CBOE:", "")
// ── Anchor: the previous daily close, held through today ─────────────────────
anchor = request.security(syminfo.tickerid, "D", close[1], lookahead = barmerge.lookahead_on)
f_move(float px, float vol, float days) =>
px * (vol / 100.0) * math.sqrt(days / 252.0)
mD = f_move(anchor, iv, 1)
// ── Plots ────────────────────────────────────────────────────────────────────
plot(showD ? anchor + mD : na, "Day +1 sd", colD, 1, plot.style_linebr)
plot(showD ? anchor - mD : na, "Day -1 sd", colD, 1, plot.style_linebr)
plot(showD and show2 ? anchor + 2 * mD : na, "Day +2 sd", color.new(colD, 60), 1, plot.style_linebr)
plot(showD and show2 ? anchor - 2 * mD : na, "Day -2 sd", color.new(colD, 60), 1, plot.style_linebr)
// Week bands are anchored to the last close before the week began
wkAnchor = request.security(syminfo.tickerid, "W", close[1], lookahead = barmerge.lookahead_on)
mWk = f_move(wkAnchor, iv, 5)
plot(showW ? wkAnchor + mWk : na, "Week +1 sd", colW, 2, plot.style_linebr)
plot(showW ? wkAnchor - mWk : na, "Week -1 sd", colW, 2, plot.style_linebr)
plot(showW and show2 ? wkAnchor + 2 * mWk : na, "Week +2 sd", color.new(colW, 60), 1, plot.style_linebr)
plot(showW and show2 ? wkAnchor - 2 * mWk : na, "Week -2 sd", color.new(colW, 60), 1, plot.style_linebr)
// ── Next session and next week, from the latest close ──────────────────────
// the latest volatility close, not the one the bar opened with
ivNext = mode == "Auto" and hasIdx ? idxNow : iv
nxtD = f_move(close, ivNext, 1)
nxtW = f_move(close, ivNext, 5)
var line[] fwd = array.new<line>()
if barstate.islast
while array.size(fwd) > 0
line.delete(array.pop(fwd))
x1 = bar_index
x2 = bar_index + 5
array.push(fwd, line.new(x1, close + nxtD, x2, close + nxtD, color = colD, style = line.style_dashed, width = 1))
array.push(fwd, line.new(x1, close - nxtD, x2, close - nxtD, color = colD, style = line.style_dashed, width = 1))
if showW
array.push(fwd, line.new(x1, close + nxtW, x2, close + nxtW, color = colW, style = line.style_dashed, width = 2))
array.push(fwd, line.new(x1, close - nxtW, x2, close - nxtW, color = colW, style = line.style_dashed, width = 2))
// ── Table ────────────────────────────────────────────────────────────────────
var table t = table.new(position.top_right, 2, 5, bgcolor = color.new(color.black, 85), border_width = 1)
if showTbl and barstate.islast
table.cell(t, 0, 0, "Vol", text_color = color.gray, text_size = size.small)
table.cell(t, 1, 0, ivLabel + " " + str.tostring(ivNext, "#.0") + "%", text_size = size.small)
table.cell(t, 0, 1, "From", text_color = color.gray, text_size = size.small)
table.cell(t, 1, 1, str.tostring(close, format.mintick), text_size = size.small)
table.cell(t, 0, 2, "Next day 1 sd", text_color = color.gray, text_size = size.small)
table.cell(t, 1, 2, str.tostring(close - nxtD, format.mintick) + " to " + str.tostring(close + nxtD, format.mintick), text_color = colD, text_size = size.small)
table.cell(t, 0, 3, "Next week 1 sd", text_color = color.gray, text_size = size.small)
table.cell(t, 1, 3, str.tostring(close - nxtW, format.mintick) + " to " + str.tostring(close + nxtW, format.mintick), text_color = colW, text_size = size.small)
table.cell(t, 0, 4, "Move", text_color = color.gray, text_size = size.small)
table.cell(t, 1, 4, "+/-" + str.tostring(nxtD / close * 100, "#.00") + "% day, +/-" + str.tostring(nxtW / close * 100, "#.00") + "% week", text_size = size.small)
How to read the bands
- Inside the day bands is a move the options market had priced. A close outside them is a bigger move than implied volatility priced for that day.
- One standard deviation is the range a normal curve puts about 68 percent of outcomes inside. Real prices have fatter tails, so closes land outside it more often than that, most of all around earnings and big news.
- The week bands stay fixed from the week's opening close, so you can see how much of the week's priced move is already used.
- Check the table's Vol line first. VIX, VXN, RVX or VXD, or IV (manual), means option-priced. HV means past moves only.
- The bands are a range, not a direction. They do not say which way price goes. They are the options market's range.
Real option-priced levels for any stock
Want the real option-priced levels for any stock, not just VIX? See the free levels map. It shows the put wall, the call wall, zero gamma and the priced range for about 1,180 US stocks and funds, from each close, with no account.
Questions people ask
What is the expected move?
The expected move is the one standard deviation range the options market prices for a stock over a stretch of time. This script works it out as price times implied volatility times the square root of days over 252.
Is the expected move a prediction?
No. It is the options market's range, read from implied volatility. It gives no direction, and price closes outside it often.
Why does my stock show HV instead of IV?
Only SPY, QQQ, IWM, DIA and their index and futures twins have a volatility index the script can read. On any other symbol it uses the IV you type in Manual IV, or, if that is 0, the realized volatility of the last 20 daily closes, marked HV. Realized volatility is the stock's own past moves, not an option price.
Is the script free to use and change?
Yes. It is open source under the Mozilla Public License 2.0. Keep the license line at the top if you share a changed copy.
More on options levels
- The expected move, from option prices
- What is a put wall?
- What is a call wall?
- Gamma exposure (GEX), explained
- Levels for any ticker, from the latest close
Levels for any ticker, every close
The levels pages need no account. An account adds the daily letter by email before each open and every window on the desk. Everything is free until June 30, 2027. No card.