This indicator calculates an advanced Fisher Transform oscillator in a separate pane, using customizable smoothing algorithms, a signal line, and defined overbought and oversold thresholds.
//@version=6
// ============================================================================
// Fisher Transform Advanced [WavesUnchained]
// Version: 1.3.2
// Author: WavesUnchained
// Build: 2026-10-02 00:00:00
// ============================================================================
// Fisher Transform with trend context, stall/absorption, conviction markers,
// and directional long/short coloring on a zero-centered reversal core.
//
// Features:
// ✓ Fisher Transform core with pluggable smoothing and signal line
// ✓ Zero-centered panel with configurable Fisher extreme zones
// ✓ Stall/absorption context: marks crosses contradicted by flat price as weak
// ✓ Trend context line (slow Fisher): support the fast line rests on
// ✓ Trend↔Fisher divergence wedge: fast and trend move opposite
// ✓ Long/Short coloring for trend context, histogram, and divergence wedge
// ✓ Sentiment Bar — live ±100 OB/OS extremity score + mini bar
// ✓ Signal Quality — optional 0-100 conviction score per Bull/Bear cross
// ✓ Gradient line color, shadow fills, and alerts
//
// ============================================================================
indicator("Fisher Transform Advanced [WavesUnchained]", "Fisher·ADV", format=format.price, precision=2, overlay=false, max_labels_count=500)
// ─────────────────────────────────────────────────────────────────────────────
// INPUTS
// ─────────────────────────────────────────────────────────────────────────────
g_core = "1 · Core"
src = input.source(hl2, "Source", group=g_core)
fishLen = input.int(10, "Fisher Length", minval=2, group=g_core)
avgLen = input.int(2, "Average Length", minval=1, group=g_core)
sigLen = input.int(9, "Signal Length", minval=1, group=g_core)
smoothType = input.string("EMA", "Smoothing Type",
options=["EMA", "SMA", "RMA", "WMA", "SuperSmoother", "T3", "KAMA", "JMA Approx"],
group=g_core)
jmaPhase = input.int(50, " JMA Phase", minval=-100, maxval=100, group=g_core)
jmaPower = input.float(2.0, " JMA Power", minval=1.0, maxval=4.0, step=0.25, group=g_core)
g_levels = "2 · Mid / Levels"
midLine = input.float(0.0, "Midline", group=g_levels)
obLevel = input.float(1.5, "Overbought", minval=0, step=0.1, group=g_levels)
osLevel = input.float(-1.5, "Oversold", maxval=0, step=0.1, group=g_levels)
g_stall = "3 · Stall / Absorption"
useStall = input.bool(true, "Detect Stall (Fisher moves, price holds)", group=g_stall)
stallLen = input.int(5, "Stall Lookback (bars)", minval=1, group=g_stall)
stallFlatATR = input.float(0.5, "Max Price Move (ATR)", minval=0.0, step=0.1, group=g_stall)
stallFishMin = input.float(0.75, "Min Fisher Move", minval=0, step=0.05, group=g_stall)
g_ctx = "4 · Trend Context"
useCtx = input.bool(true, "Show Trend Context Line", group=g_ctx)
ctxLen = input.int(40, "Trend Fisher Length", minval=2, group=g_ctx)
g_conv = "5 · Conviction"
useExtremeOnly = input.bool(true, "Extreme Signals: require OB/OS zone", group=g_conv)
lookbackExtreme = input.int(5, "OB/OS Lookback (bars)", minval=1, group=g_conv)
showMidCross = input.bool(true, "Show Zero-Cross Markers", group=g_conv)
g_div = "6 · Divergence"
showDiv = input.bool(true, "Highlight Trend ↔ Fisher Divergence", group=g_div)
divLen = input.int(4, "Divergence Slope Lookback", minval=1, group=g_div)
divMin = input.float(0.5, "Min Fast Slope", minval=0, step=0.05, group=g_div)
g_plots = "7 · Plots"
showShadow = input.bool(true, "Shadow Fill (Fisher vs Zero)", group=g_plots)
showFill = input.bool(true, "Fill Fisher / Signal", group=g_plots)
showHist = input.bool(true, "Show Histogram", group=g_plots)
showSignals = input.bool(true, "Show Signal Markers", group=g_plots)
g_col = "7 · Plots · Colors"
colBull = input.color(#00bcd4, "Bull (level)", group=g_col)
colBear = input.color(#f06292, "Bear (level)", group=g_col)
colLong = input.color(#00c853, "Long (trend/momentum)", group=g_col)
colShort = input.color(#d50000, "Short (trend/momentum)", group=g_col)
g_score = "8 · Score"
showSentiment = input.bool(true, "Show Sentiment Bar", group=g_score,
tooltip="Live label at the panel's right edge — how far Fisher sits inside its own OB/OS zone, signed ±100. Not a fixed Bullish/Bearish claim. Mirrors Williams VIX Fix Advanced's Sentiment Bar.")
showQuality = input.bool(false, "Show Signal Quality Labels", group=g_score,
tooltip="Adds a 0-100 quality score next to each Bull/Bear Extreme marker: 50% OB/OS-zone depth + 25% context agreement + 25% stall-free. Mirrors Williams VIX Fix Advanced's Spike Quality.")
// ─────────────────────────────────────────────────────────────────────────────
// SMOOTHING FUNCTIONS
// ─────────────────────────────────────────────────────────────────────────────
f_supersmoother(series float x, simple int len) =>
float a1 = math.exp(-1.414 * math.pi / len)
float b1 = 2.0 * a1 * math.cos(1.414 * math.pi / len)
float c2 = b1
float c3 = -(a1 * a1)
float c1 = 1.0 - c2 - c3
var float ss = na
ss := c1 * (x + nz(x[1])) / 2.0 + c2 * nz(ss[1]) + c3 * nz(ss[2])
ss
f_t3(series float x, simple int len) =>
float b = 0.7
float e1 = ta.ema(x, len)
float e2 = ta.ema(e1, len)
float e3 = ta.ema(e2, len)
float e4 = ta.ema(e3, len)
float e5 = ta.ema(e4, len)
float e6 = ta.ema(e5, len)
-(b * b * b) * e6 + (3.0 * b * b + 3.0 * b * b * b) * e5 + (-6.0 * b * b - 3.0 * b - 3.0 * b * b * b) * e4 + (1.0 + 3.0 * b + b * b * b + 3.0 * b * b) * e3
f_kama(series float x, simple int len) =>
float change = math.abs(x - x[len])
float vol = math.sum(math.abs(x - x[1]), len)
float er = vol != 0.0 ? change / vol : 0.0
float sc = math.pow(er * (2.0 / 3.0 - 2.0 / 31.0) + 2.0 / 31.0, 2)
var float kama = na
kama := nz(kama[1], x) + sc * (x - nz(kama[1], x))
kama
f_jma(series float x, simple int len, simple int phase, simple float power) =>
var float jma = na
var float e0 = na
var float e1 = na
var float e2 = na
float phaseRatio = phase < -100 ? 0.5 : phase > 100 ? 2.5 : phase / 100.0 + 1.5
float beta = 0.45 * (len - 1) / (0.45 * (len - 1) + 2.0)
float alpha = math.pow(beta, power)
e0 := (1.0 - alpha) * x + alpha * nz(e0[1], x)
e1 := (x - e0) * (1.0 - beta) + beta * nz(e1[1], 0.0)
e2 := (e0 + phaseRatio * e1 - nz(jma[1], x)) * math.pow(1.0 - alpha, 2.0) + math.pow(alpha, 2.0) * nz(e2[1], 0.0)
jma := nz(jma[1], x) + e2
jma
f_smooth(series float x, simple int len, simple string mode) =>
switch mode
"SMA" => ta.sma(x, len)
"RMA" => ta.rma(x, len)
"WMA" => ta.wma(x, len)
"SuperSmoother" => f_supersmoother(x, len)
"T3" => f_t3(x, len)
"KAMA" => f_kama(x, len)
"JMA Approx" => f_jma(x, len, jmaPhase, jmaPower)
=> ta.ema(x, len)
f_fisher(series float x, simple int len) =>
float highestSrc = ta.highest(x, len)
float lowestSrc = ta.lowest(x, len)
float rangeSrc = highestSrc - lowestSrc
float normalized = rangeSrc != 0.0 ? (x - lowestSrc) / rangeSrc - 0.5 : 0.0
var float value = na
var float fish = na
value := 0.66 * normalized + 0.67 * nz(value[1])
value := math.max(math.min(value, 0.999), -0.999)
fish := 0.5 * math.log((1.0 + value) / (1.0 - value)) + 0.5 * nz(fish[1])
fish
// ─────────────────────────────────────────────────────────────────────────────
// FISHER CORE
// ─────────────────────────────────────────────────────────────────────────────
fishRaw = f_fisher(src, fishLen)
fishLine = f_smooth(fishRaw, avgLen, smoothType)
signal = f_smooth(fishLine, sigLen, smoothType)
hist = fishLine - signal
ctxRaw = f_fisher(src, ctxLen)
ctxLine = f_smooth(ctxRaw, avgLen, smoothType)
// ─────────────────────────────────────────────────────────────────────────────
// MID / LEVELS
// ─────────────────────────────────────────────────────────────────────────────
wasOversold = ta.lowest(fishLine, lookbackExtreme) <= osLevel
wasOverbought = ta.highest(fishLine, lookbackExtreme) >= obLevel
// ─────────────────────────────────────────────────────────────────────────────
// STALL / ABSORPTION
// ─────────────────────────────────────────────────────────────────────────────
bullCross = ta.crossover(fishLine, signal)
bearCross = ta.crossunder(fishLine, signal)
bullExtreme = bullCross and (not useExtremeOnly or wasOversold)
bearExtreme = bearCross and (not useExtremeOnly or wasOverbought)
bullMidCross = ta.crossover(fishLine, midLine)
bearMidCross = ta.crossunder(fishLine, midLine)
float atrRef = ta.atr(14)
float fishChg = fishLine - fishLine[stallLen]
float priceChg = atrRef != 0.0 ? (close - close[stallLen]) / atrRef : 0.0
bool flatPx = math.abs(priceChg) < stallFlatATR
bool stallBull = useStall and fishChg < -stallFishMin and flatPx
bool stallBear = useStall and fishChg > stallFishMin and flatPx
bool stallNow = stallBull or stallBear
// ─────────────────────────────────────────────────────────────────────────────
// TREND CONTEXT
// ─────────────────────────────────────────────────────────────────────────────
bool ctxBull = ctxLine > midLine
bool ctxBear = ctxLine < midLine
bool bearCounter = useCtx and bearExtreme and ctxBull
bool bullCounter = useCtx and bullExtreme and ctxBear
// ─────────────────────────────────────────────────────────────────────────────
// CONVICTION
// ─────────────────────────────────────────────────────────────────────────────
bool bearStrong = bearExtreme and not (stallBull or bearCounter)
bool bearWeak = bearExtreme and (stallBull or bearCounter)
bool bullStrong = bullExtreme and not (stallBear or bullCounter)
bool bullWeak = bullExtreme and (stallBear or bullCounter)
// ─────────────────────────────────────────────────────────────────────────────
// SCORE — Sentiment Bar (live extremity read) and Signal Quality (0-100 per
// cross), same weighting as Williams VIX Fix Advanced's Spike Quality, adapted
// to a single signed line instead of two independent bull/bear formulas.
// ─────────────────────────────────────────────────────────────────────────────
float sentBullPct = (obLevel - midLine) != 0.0 ? math.max(0.0, fishLine - midLine) / (obLevel - midLine) * 100.0 : 0.0
float sentBearPct = (midLine - osLevel) != 0.0 ? math.max(0.0, midLine - fishLine) / (midLine - osLevel) * 100.0 : 0.0
float sentScore = math.max(-100.0, math.min(100.0, sentBullPct - sentBearPct))
float sentAbsScore = math.abs(sentScore)
// Depth = penetration beyond the zone in units of the zone-to-midline distance,
// capped at 1 so it contributes at most its documented 50 points
float bullDepth = (midLine - osLevel) != 0.0 ? math.max(0.0, math.min(1.0, (osLevel - ta.lowest(fishLine, lookbackExtreme)) / math.abs(midLine - osLevel))) : 0.0
float bearDepth = (obLevel - midLine) != 0.0 ? math.max(0.0, math.min(1.0, (ta.highest(fishLine, lookbackExtreme) - obLevel) / math.abs(obLevel - midLine))) : 0.0
float bullQuality = math.min(100.0, bullDepth * 50.0 + (ctxBull ? 25.0 : 0.0) + (not stallBear ? 25.0 : 0.0))
float bearQuality = math.min(100.0, bearDepth * 50.0 + (ctxBear ? 25.0 : 0.0) + (not stallBull ? 25.0 : 0.0))
// ─────────────────────────────────────────────────────────────────────────────
// DIVERGENCE
// ─────────────────────────────────────────────────────────────────────────────
float fastDir = fishLine - fishLine[divLen]
float slowDir = ctxLine - ctxLine[divLen]
bool divBull = useCtx and showDiv and fastDir < -divMin and slowDir > 0.0
bool divBear = useCtx and showDiv and fastDir > divMin and slowDir < 0.0
// ─────────────────────────────────────────────────────────────────────────────
// COLORS
// ─────────────────────────────────────────────────────────────────────────────
color lineCol = color.from_gradient(fishLine, osLevel, obLevel, colBull, colBear)
color lineCol2 = color.from_gradient(signal, osLevel, obLevel, color.new(colBull, 40), color.new(colBear, 40))
color ctxCol = ctxLine >= midLine ? color.new(colLong, 55) : color.new(colShort, 55)
histRising = hist >= hist[1]
histColor = hist >= 0.0
? (histRising ? colLong : color.new(colLong, 55))
: (not histRising ? colShort : color.new(colShort, 55))
// ─────────────────────────────────────────────────────────────────────────────
// HLINES + ZONE FILLS
// ─────────────────────────────────────────────────────────────────────────────
hMid = hline(midLine, "Zero", color=color.new(color.gray, 60), linestyle=hline.style_dotted, linewidth=1)
hOB = hline(obLevel, "Overbought", color=color.new(color.red, 65), linestyle=hline.style_dashed, linewidth=1)
hOS = hline(osLevel, "Oversold", color=color.new(#00bcd4, 65), linestyle=hline.style_dashed, linewidth=1)
// ─────────────────────────────────────────────────────────────────────────────
// PLOTS
// ─────────────────────────────────────────────────────────────────────────────
color histColorFinal = stallNow ? color.new(histColor, 78) : histColor
plot(showHist ? hist : na, "Histogram", style=plot.style_columns, color=histColorFinal)
pMid = plot(midLine, display=display.none)
pCtx = plot(useCtx ? ctxLine : na, "Trend Context", color=ctxCol, linewidth=2)
pSig = plot(signal, "Fisher Signal", color=lineCol2, linewidth=1)
pFish = plot(fishLine, "Fisher", color=lineCol, linewidth=2)
fill(pFish, pCtx, color=divBull ? color.new(colLong, 80) : divBear ? color.new(colShort, 80) : na,
title="Trend Divergence")
fill(pFish, pMid, obLevel, midLine, color.new(colBear, 78), color.new(colBear, 100),
title="Bear Shadow", display=showShadow ? display.all : display.none)
fill(pFish, pMid, midLine, osLevel, color.new(colBull, 100), color.new(colBull, 78),
title="Bull Shadow", display=showShadow ? display.all : display.none)
fill(pFish, pSig, color=showFill ? (fishLine >= signal ? color.new(colBull, 88) : color.new(colBear, 88)) : na,
title="Fisher Fill")
// ─────────────────────────────────────────────────────────────────────────────
// SIGNAL MARKERS
// ─────────────────────────────────────────────────────────────────────────────
plotshape(showSignals and bullStrong, "Bull Extreme", style=shape.triangleup, location=location.bottom, color=colBull, size=size.small)
plotshape(showSignals and bullWeak, "Bull Extreme (absorbed)", style=shape.triangleup, location=location.bottom, color=color.new(colBull, 65), size=size.tiny)
plotshape(showSignals and bearStrong, "Bear Extreme", style=shape.triangledown, location=location.top, color=colBear, size=size.small)
plotshape(showSignals and bearWeak, "Bear Extreme (absorbed)", style=shape.triangledown, location=location.top, color=color.new(colBear, 65), size=size.tiny)
plotshape(showSignals and showMidCross and bullMidCross ? fishLine : na, "Bull Zero Cross", style=shape.circle, location=location.absolute, color=color.new(colBull, 20), size=size.tiny)
plotshape(showSignals and showMidCross and bearMidCross ? fishLine : na, "Bear Zero Cross", style=shape.circle, location=location.absolute, color=color.new(colBear, 20), size=size.tiny)
// ─────────────────────────────────────────────────────────────────────────────
// SCORE DISPLAY — Sentiment Bar (always-on read of current extremity) and
// per-cross Quality labels (why a Strong/Weak marker was graded that way)
// ─────────────────────────────────────────────────────────────────────────────
f_scoreColor(score, absS) =>
base = score > 0 ? colBear : colBull
color result = na
if absS < 15
result := color.new(color.gray, 40)
else if absS >= 80
result := color.new(base, 10)
else if absS >= 60
result := color.new(base, 30)
else if absS >= 40
result := color.new(base, 50)
else
result := color.new(base, 70)
result
int scoreBarSegments = 8
int scoreFilled = int(math.round(sentAbsScore / 100.0 * scoreBarSegments))
string scoreBarStr = str.repeat("■", scoreFilled) + str.repeat("·", scoreBarSegments - scoreFilled)
string scoreSignStr = sentScore > 0 ? "+" : ""
string sentTxt = scoreSignStr + str.tostring(sentScore, "#") + " " + scoreBarStr
color sentColor = f_scoreColor(sentScore, sentAbsScore)
var label sentLabel = na
if showSentiment and barstate.islast
label.delete(sentLabel)
sentLabel := label.new(bar_index + 3, midLine, sentTxt,
xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_left,
color=sentColor, textcolor=color.white, size=size.normal,
tooltip="How far Fisher sits inside its own OB/OS zone: 100×(Fisher−midline)/(Overbought−midline) when bullish, 100×(midline−Fisher)/(midline−Oversold) when bearish, clamped to ±100. |score| < 15 reads as balanced.")
else if not showSentiment and barstate.islast
label.delete(sentLabel)
if showQuality and bullExtreme
label.new(bar_index, fishLine, str.tostring(bullQuality, "#"),
style=label.style_label_up, color=bullStrong ? colBull : color.new(colBull, 65), textcolor=color.white, size=size.tiny,
tooltip="Bull Signal Quality " + str.tostring(bullQuality, "#") + "/100 — OB/OS-zone depth 50% + context agreement 25% + stall-free 25%.")
if showQuality and bearExtreme
label.new(bar_index, fishLine, str.tostring(bearQuality, "#"),
style=label.style_label_down, color=bearStrong ? colBear : color.new(colBear, 65), textcolor=color.white, size=size.tiny,
tooltip="Bear Signal Quality " + str.tostring(bearQuality, "#") + "/100 — OB/OS-zone depth 50% + context agreement 25% + stall-free 25%.")
// ─────────────────────────────────────────────────────────────────────────────
// ALERTS
// ─────────────────────────────────────────────────────────────────────────────
bool alertsOnBarClose = input.bool(true, "Alerts only on bar close (confirmed)", group="9 · Alerts")
bool alertOk = not alertsOnBarClose or barstate.isconfirmed
alertcondition(alertOk and bullExtreme, "Fisher Bull Signal", "FISHA · BULL CROSS OVERSOLD · {{ticker}} {{interval}}")
alertcondition(alertOk and bearExtreme, "Fisher Bear Signal", "FISHA · BEAR CROSS OVERBOUGHT · {{ticker}} {{interval}}")
alertcondition(alertOk and bullMidCross, "Fisher Cross Above Zero", "FISHA · CROSS ABOVE ZERO · {{ticker}} {{interval}}")
alertcondition(alertOk and bearMidCross, "Fisher Cross Below Zero", "FISHA · CROSS BELOW ZERO · {{ticker}} {{interval}}")
Overview
Fisher Transform Advanced [WavesUnchained] incorporates a slower trend context line, detects market stall or absorption where momentum shifts without matching price movement, and identifies divergence between fast momentum and macro trend. Plots include zero-centered levels, momentum histograms, shadow fills, and conviction signal markers. Settings allow configuring smoothing methods, lookbacks, and signal filters.
Multiple smoothing choices including JMA, SuperSmoother, and T3
Stall and absorption detection via price ATR comparison
Slow trend context line for macro direction alignment
Divergence highlighting between fast momentum and trend context
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Source
source
hl2
src
Fisher Length
int
10
fishLen
Average Length
int
2
avgLen
Signal Length
int
9
sigLen
Smoothing Type
string
EMA
smoothType
JMA Phase
int
50
jmaPhase
JMA Power
float
2.0
jmaPower
Midline
float
0.0
midLine
Overbought
float
1.5
obLevel
Oversold
float
-1.5
osLevel
Detect Stall (Fisher moves, price holds)
bool
true
useStall
Stall Lookback (bars)
int
5
stallLen
Show all 33 settings
Setting
Type
Default
Variable
Max Price Move (ATR)
float
0.5
stallFlatATR
Min Fisher Move
float
0.75
stallFishMin
Show Trend Context Line
bool
true
useCtx
Trend Fisher Length
int
40
ctxLen
Extreme Signals: require OB/OS zone
bool
true
useExtremeOnly
OB/OS Lookback (bars)
int
5
lookbackExtreme
Show Zero-Cross Markers
bool
true
showMidCross
Highlight Trend ↔ Fisher Divergence
bool
true
showDiv
Divergence Slope Lookback
int
4
divLen
Min Fast Slope
float
0.5
divMin
Shadow Fill (Fisher vs Zero)
bool
true
showShadow
Fill Fisher / Signal
bool
true
showFill
Show Histogram
bool
true
showHist
Show Signal Markers
bool
true
showSignals
Bull (level)
color
#00bcd4
colBull
Bear (level)
color
#f06292
colBear
Long (trend/momentum)
color
#00c853
colLong
Short (trend/momentum)
color
#d50000
colShort
Show Sentiment Bar
bool
true
showSentiment
Show Signal Quality Labels
bool
false
showQuality
Alerts only on bar close (confirmed)
bool
true
alertsOnBarClose
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator overlays multiple technical analysis tools onto the price chart to evaluate trend direction and trade setups. It computes an exponential moving average, a smoothed Stochastic RSI, a custom Williams Alligator using smoothed moving averages with o
This indicator plots the Schaff Trend Cycle in a separate pane. It subtracts a slow exponential moving average from a fast one, applies a stochastic cycle twice, and smooths each result to form a 0–100 oscillator. Line color follows the slope, or the upper and
This indicator calculates momentum setups based on the Relative Strength Index (RSI) and plots in a separate pane. It offers multiple scanning modes such as Continuous Break, Continuous Retracement, Flip Break, Flip Retracement, and both regular and hidden div
This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome
This indicator plots the Average Directional Index in a separate pane and colors the line teal or maroon according to whether plus DI is above minus DI. A horizontal key level and a silver background mark periods when ADX exceeds that threshold. With labels en
Standardized Trend Map calculates series momentum relative to active price range across 40 distinct lookback periods ranging from 2 to 80 bars on an exponential moving average source. Each standardized calculation rounds to an integer values of -1, 0, or 1 to