This is a simplified conversion of the Trade Wzrd Null Range indicator. Additional Watchlist Column code and lower indicator code are below.
This is a good reversion to the mean (centerline) indicator. The outside bands are extension zones where price will have a good probability of reverting back to the center line. This picture is a 5 minute chart of /NQ. Notice every time price is in the extension zones, it reverted back to the mean. It doesn't always revert back. It may stay extended for awhile. But, it'll always eventually get back to center.
Original concept: https://www.tradingview.com/script/P9cPymVG-Trade-Wzrd-Null-Range-Rampage-Series/
Watchlist Column Code:
Lower Oscillator code:
This is a good reversion to the mean (centerline) indicator. The outside bands are extension zones where price will have a good probability of reverting back to the center line. This picture is a 5 minute chart of /NQ. Notice every time price is in the extension zones, it reverted back to the mean. It doesn't always revert back. It may stay extended for awhile. But, it'll always eventually get back to center.
Original concept: https://www.tradingview.com/script/P9cPymVG-Trade-Wzrd-Null-Range-Rampage-Series/
Code:
# ============================================================================
# Trade Wzrd - Null Range
# Original Code: https://www.tradingview.com/script/P9cPymVG-Trade-Wzrd-Null-Range-Rampage-Series/
# Converted by Chewie 8/9/2026
# ============================================================================
declare upper;
# ============================================================================
# INPUTS
# ============================================================================
input colorbar = yes;
input RangeLookback = 200;
input OuterWallSigma0 = 1.5;
input OuterWallSigma = 2.0;
input OuterWallSigma2 = 2.5;
input ShowWalls = yes;
input ShowNullRange = yes;
# --- Style Colors ---
DefineGlobalColor("Premium", CreateColor(255, 61, 113));
DefineGlobalColor("Discount", CreateColor(0, 225, 255));
DefineGlobalColor("EQSolid", CreateColor(178, 181, 190));
# ============================================================================
# CORE STRUCTURE
# ============================================================================
def res = Highest(high, RangeLookback);
def sup = Lowest(low, RangeLookback);
def chanOK = !IsNaN(res) and !IsNaN(sup) and res > sup;
# ============================================================================
# NULL RANGE
# ============================================================================
def volSum = fold i = 0 to RangeLookback with s = 0 do s + GetValue(volume, i);
def vwapNum = fold j = 0 to RangeLookback with sv = 0 do sv + GetValue(volume, j) * GetValue(close, j);
def rawVWAP = if volSum > 0 then vwapNum / volSum else (res + sup) / 2;
def varNum = fold k = 0 to RangeLookback with sv2 = 0 do
sv2 + GetValue(volume, k) * Power(GetValue(close, k) - rawVWAP, 2);
def sigV = if volSum > 0 then Sqrt(varNum / volSum) else (res - sup) / 4;
def rangeMid = (res + sup) / 2;
def rangeSpan = res - sup;
def eqV = if chanOK then rawVWAP else (res + sup) / 2;
# ============================================================================
# CHANNEL WALLS
# ============================================================================
def up1 = if chanOK then eqV + sigV * OuterWallSigma0 else Double.NaN;
def lo1 = if chanOK then eqV - sigV * OuterWallSigma0 else Double.NaN;
def up2 = if chanOK then eqV + sigV * OuterWallSigma else Double.NaN;
def lo2 = if chanOK then eqV - sigV * OuterWallSigma else Double.NaN;
def up3 = if chanOK then eqV + sigV * OuterWallSigma2 else Double.NaN;
def lo3 = if chanOK then eqV - sigV * OuterWallSigma2 else Double.NaN;
# ============================================================================
# PLOTS
# ============================================================================
plot NullRangeLine = if ShowNullRange and chanOK then eqV else Double.NaN;
NullRangeLine.SetLineWeight(3);
NullRangeLine.setdefaultColor(color.GRAY);
plot UpperWall0 = if ShowWalls and chanOK then up1 else Double.NaN;
UpperWall0.SetDefaultColor(GlobalColor("Premium"));
UpperWall0.SetLineWeight(2);
plot LowerWall0 = if ShowWalls and chanOK then lo1 else Double.NaN;
LowerWall0.SetDefaultColor(GlobalColor("Discount"));
LowerWall0.SetLineWeight(2);
plot UpperWall = if ShowWalls and chanOK then up2 else Double.NaN;
UpperWall.SetDefaultColor(GlobalColor("Premium"));
UpperWall.SetLineWeight(2);
plot LowerWall = if ShowWalls and chanOK then lo2 else Double.NaN;
LowerWall.SetDefaultColor(GlobalColor("Discount"));
LowerWall.SetLineWeight(2);
plot UpperWall2 = if ShowWalls and chanOK then up3 else Double.NaN;
UpperWall2.SetDefaultColor(GlobalColor("Premium"));
UpperWall2.SetLineWeight(2);
plot LowerWall2 = if ShowWalls and chanOK then lo3 else Double.NaN;
LowerWall2.SetDefaultColor(GlobalColor("Discount"));
LowerWall2.SetLineWeight(2);
AssignPriceColor(if !colorbar then Color.CURRENT else if high > UpperWall then Color.MAGENTA else if high > UpperWall0 then Color.RED else if low < LowerWall then Color.CYAN else if low < LowerWall0 then Color.GREEN else Color.GRAY);
AddCloud(UpperWall0, UpperWall, CreateColor(255, 70, 123), CreateColor(255, 70, 123));
AddCloud(UpperWall0, NullRangeLine, CreateColor(155, 10, 23), CreateColor(155, 10, 23));
AddCloud(NullRangeLine, LowerWall0, CreateColor(0, 120, 90), CreateColor(0, 120, 90));
AddCloud(LowerWall0, LowerWall, CreateColor(30, 245, 225), CreateColor(30, 245, 225));
Watchlist Column Code:
Code:
# ============================================================================
# Trade Wzrd - Null Range Watchlist Column
# Original Code: https://www.tradingview.com/script/P9cPymVG-Trade-Wzrd-Null-Range-Rampage-Series/
# Converted by Chewie 8/9/2026
# ============================================================================
declare upper;
# ============================================================================
# INPUTS
# ============================================================================
input RangeLookback = 200;
input OuterWallSigma0 = 1.5;
input OuterWallSigma = 2.0;
input OuterWallSigma2 = 2.5;
input ShowWalls = yes;
input ShowNullRange = yes;
# ============================================================================
# CORE STRUCTURE
# ============================================================================
def res = Highest(high, RangeLookback);
def sup = Lowest(low, RangeLookback);
def chanOK = !IsNaN(res) and !IsNaN(sup) and res > sup;
# ============================================================================
# NULL RANGE
# ============================================================================
def volSum = fold i = 0 to RangeLookback with s = 0 do s + GetValue(volume, i);
def vwapNum = fold j = 0 to RangeLookback with sv = 0 do sv + GetValue(volume, j) * GetValue(close, j);
def rawVWAP = if volSum > 0 then vwapNum / volSum else (res + sup) / 2;
def varNum = fold k = 0 to RangeLookback with sv2 = 0 do
sv2 + GetValue(volume, k) * Power(GetValue(close, k) - rawVWAP, 2);
def sigV = if volSum > 0 then Sqrt(varNum / volSum) else (res - sup) / 4;
def rangeMid = (res + sup) / 2;
def rangeSpan = res - sup;
def eqV = if chanOK then rawVWAP else (res + sup) / 2;
# ============================================================================
# CHANNEL WALLS
# ============================================================================
def up1 = if chanOK then eqV + sigV * OuterWallSigma0 else Double.NaN;
def lo1 = if chanOK then eqV - sigV * OuterWallSigma0 else Double.NaN;
def up2 = if chanOK then eqV + sigV * OuterWallSigma else Double.NaN;
def lo2 = if chanOK then eqV - sigV * OuterWallSigma else Double.NaN;
def up3 = if chanOK then eqV + sigV * OuterWallSigma2 else Double.NaN;
def lo3 = if chanOK then eqV - sigV * OuterWallSigma2 else Double.NaN;
# ============================================================================
# PLOTS
# ============================================================================
plot NullRangeLine = if ShowNullRange and chanOK then eqV else Double.NaN;
NullRangeLine.SetLineWeight(3);
NullRangeLine.setdefaultColor(color.GRAY);
plot UpperWall0 = if ShowWalls and chanOK then up1 else Double.NaN;
UpperWall0.SetDefaultColor(GlobalColor("Premium"));
UpperWall0.SetLineWeight(2);
plot LowerWall0 = if ShowWalls and chanOK then lo1 else Double.NaN;
LowerWall0.SetDefaultColor(GlobalColor("Discount"));
LowerWall0.SetLineWeight(2);
plot UpperWall = if ShowWalls and chanOK then up2 else Double.NaN;
UpperWall.SetDefaultColor(GlobalColor("Premium"));
UpperWall.SetLineWeight(2);
plot LowerWall = if ShowWalls and chanOK then lo2 else Double.NaN;
LowerWall.SetDefaultColor(GlobalColor("Discount"));
LowerWall.SetLineWeight(2);
plot UpperWall2 = if ShowWalls and chanOK then up3 else Double.NaN;
UpperWall2.SetDefaultColor(GlobalColor("Premium"));
UpperWall2.SetLineWeight(2);
plot LowerWall2 = if ShowWalls and chanOK then lo3 else Double.NaN;
LowerWall2.SetDefaultColor(GlobalColor("Discount"));
LowerWall2.SetLineWeight(2);
plot XBUY = low < Lowerwall;
plot XSELL = high > UpperWall;
plot BUY = low < Lowerwall0;
plot SELL = high > UpperWall0;
AddLabel(yes, if XBUY then "XBUY" else if XSELL then "XSELL" else if sell then "SELL" else if buy then "BUY" else " ", if XBUY then color.BLACK else if XSELL then color.BLACK else if sell then color.yellow else if buy then color.dark_green else Color.BLACK);
AssignBACKGROUNDColor(if XBUY then color.cyan else if Xsell then color.MAGENTA else if buy then color.GREEN else if sell then color.red else color.black);
Lower Oscillator code:
Code:
# ============================================================================
# Trade Wzrd - Null Range Oscillator
# Based on Trade Wzrd - Null Range
# Original Code: https://www.tradingview.com/script/P9cPymVG-Trade-Wzrd-Null-Range-Rampage-Series/
# Converted by Chewie 8/9/2026
# Oscillator version by Chewie 9/17/2026
# ============================================================================
declare lower;
# ============================================================================
# INPUTS
# ============================================================================
input RangeLookback = 200;
input OuterWallSigma0 = 1.5;
input OuterWallSigma = 2.0;
input OuterWallSigma2 = 2.5;
# --- Style Colors ---
DefineGlobalColor("Premium", CreateColor(255, 61, 113));
DefineGlobalColor("Discount", CreateColor(0, 225, 255));
DefineGlobalColor("EQSolid", CreateColor(178, 181, 190));
DefineGlobalColor("UpperZone", CreateColor(255, 70, 123));
DefineGlobalColor("LowerZone", CreateColor(0, 120, 90));
DefineGlobalColor("UpperOuter", CreateColor(155, 10, 23));
DefineGlobalColor("LowerOuter", CreateColor(30, 245, 225));
# ============================================================================
# CORE STRUCTURE
# ============================================================================
def res = Highest(high, RangeLookback);
def sup = Lowest(low, RangeLookback);
def chanOK = !IsNaN(res) and !IsNaN(sup) and res > sup;
# ============================================================================
# NULL RANGE MATH - identical to overlay
# ============================================================================
def volSum = fold i = 0 to RangeLookback with s = 0 do s + GetValue(volume, i);
def vwapNum = fold j = 0 to RangeLookback with sv = 0 do sv + GetValue(volume, j) * GetValue(close, j);
def rawVWAP = if volSum > 0 then vwapNum / volSum else (res + sup) / 2;
def varNum = fold k = 0 to RangeLookback with sv2 = 0 do
sv2 + GetValue(volume, k) * Power(GetValue(close, k) - rawVWAP, 2);
def sigV = if volSum > 0 then Sqrt(varNum / volSum) else (res - sup) / 4;
def eqV = if chanOK then rawVWAP else (res + sup) / 2;
def oscVal = if chanOK and sigV > 0 then (close - eqV) / sigV else 0;
# ============================================================================
# FIXED HORIZONTAL LEVELS
# ============================================================================
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(GlobalColor("EQSolid"));
ZeroLine.SetLineWeight(2);
plot UpL0 = OuterWallSigma0;
plot DnL0 = -OuterWallSigma0;
plot UpL1 = OuterWallSigma;
plot DnL1 = -OuterWallSigma;
plot UpL2 = OuterWallSigma2;
plot DnL2 = -OuterWallSigma2;
UpL0.SetDefaultColor(GlobalColor("Premium"));
UpL0.SetLineWeight(2);
DnL0.SetDefaultColor(GlobalColor("Discount"));
DnL0.SetLineWeight(2);
UpL1.SetDefaultColor(GlobalColor("Premium"));
UpL1.SetLineWeight(2);
DnL1.SetDefaultColor(GlobalColor("Discount"));
DnL1.SetLineWeight(2);
UpL2.SetDefaultColor(GlobalColor("Premium"));
UpL2.SetLineWeight(2);
DnL2.SetDefaultColor(GlobalColor("Discount"));
DnL2.SetLineWeight(2);
# ============================================================================
# OSCILLATOR PLOT
# ============================================================================
plot Osc = if chanOK then oscVal else Double.NaN;
Osc.SetLineWeight(2);
Osc.AssignValueColor(
if oscVal > OuterWallSigma then Color.MAGENTA
else if oscVal > OuterWallSigma0 then GlobalColor("Premium")
else if oscVal < -OuterWallSigma then Color.CYAN
else if oscVal < -OuterWallSigma0 then GlobalColor("Discount")
else Color.GRAY
);
# ============================================================================
# CLOUDS - mirror the overlay zone fills
# ============================================================================
AddCloud(UpL0, UpL1, GlobalColor("UpperZone"), GlobalColor("UpperZone"));
AddCloud(UpL0, ZeroLine, GlobalColor("UpperOuter"), GlobalColor("UpperOuter"));
AddCloud(ZeroLine, DnL0, GlobalColor("LowerZone"), GlobalColor("LowerZone"));
AddCloud(DnL0, DnL1, GlobalColor("LowerOuter"), GlobalColor("LowerOuter"));
Last edited: