//@version=6
indicator(
title="Chaikin Fisher Transform Divergence & Early Reversal",
shorttitle="CFisherDiv",
format=format.price)
// VOLUME CHECK
var cumVol = 0.
cumVol += nz(volume)
if barstate.islast and cumVol == 0
runtime.error("Data provider does not supply volume information.")
grpChaikin = "Chaikin Oscillator"
shortLen = input.int(3, minval=1, title="Fast Length", group=grpChaikin)
longLen = input.int(10, minval=1, title="Slow Length", group=grpChaikin)
grpFisher = "Fisher Transform"
fishLen = input.int(10, minval=2, title="Fisher Normalization Length", group=grpFisher)
obLevel = input.float(1.5, title="Overbought Level", group=grpFisher)
osLevel = input.float(-1.5, title="Oversold Level", group=grpFisher)
grpDiv = "Divergence"
showDiv = input.bool(true, title="Show Divergences", group=grpDiv)
pivL = input.int(4, minval=1, title="Pivot Left Bars", group=grpDiv)
pivR = input.int(4, minval=1, title="Pivot Right Bars", group=grpDiv)
maxPivBars = input.int(60, minval=5, title="Max Bars Between Pivots", group=grpDiv)
grpEarly = "Early Reversal"
showEarly = input.bool(true, title="Show Early Reversal Signals", group=grpEarly)
cooldownB = input.int(5, minval=0, title="Signal Cooldown (Bars)", group=grpEarly)
// CHAIKIN OSCILLATOR
osc = ta.ema(ta.accdist, shortLen) - ta.ema(ta.accdist, longLen)
// FISHER TRANSFORM
hi = ta.highest(osc, fishLen)
lo = ta.lowest(osc, fishLen)
var float value1 = 0.0
range_ = hi - lo
rawVal = range_ != 0 ? (osc - lo) / range_ - 0.5 : 0.0
value1 := 0.33 * 2 * rawVal + 0.67 * nz(value1[1])
value1 := math.max(math.min(value1, 0.999), -0.999)
var float fish = 0.0
fish := 0.5 * math.log((1 + value1) / (1 - value1)) + 0.5 * nz(fish[1])
trigger = fish[1]
// BASE REGIME SIGNALS
longCross = ta.crossover(fish, trigger)
shortCross = ta.crossunder(fish, trigger)
// ────────────────────────────────────────────────────────────
// PIVOT-BASED DIVERGENCE ENGINE & LINE DRAWING
// ────────────────────────────────────────────────────────────
fishPL = ta.pivotlow(fish, pivL, pivR)
fishPH = ta.pivothigh(fish, pivL, pivR)
var float prevFishLowVal = na
var int prevFishLowBar = na
var float prevPriceAtLow = na
var float prevFishHighVal = na
var int prevFishHighBar = na
var float prevPriceAtHigh = na
bool regBullDiv = false
bool hidBullDiv = false
bool regBearDiv = false
bool hidBearDiv = false
if not na(fishPL) and barstate.isconfirmed
pivotBar = bar_index - pivR
priceAtLow = low[pivR]
if not na(prevFishLowVal) and (pivotBar - prevFishLowBar) <= maxPivBars
if priceAtLow < prevPriceAtLow and fishPL > prevFishLowVal
regBullDiv := true
if showDiv
line.new(x1=prevFishLowBar, y1=prevFishLowVal, x2=pivotBar, y2=fishPL, color=#26A69A, width=2, style=line.style_solid)
if priceAtLow > prevPriceAtLow and fishPL < prevFishLowVal
hidBullDiv := true
if showDiv
line.new(x1=prevFishLowBar, y1=prevFishLowVal, x2=pivotBar, y2=fishPL, color=color.new(#26A69A, 30), width=2, style=line.style_dashed)
prevFishLowVal := fishPL
prevFishLowBar := pivotBar
prevPriceAtLow := priceAtLow
if not na(fishPH) and barstate.isconfirmed
pivotBarH = bar_index - pivR
priceAtHigh = high[pivR]
if not na(prevFishHighVal) and (pivotBarH - prevFishHighBar) <= maxPivBars
if priceAtHigh > prevPriceAtHigh and fishPH < prevFishHighVal
regBearDiv := true
if showDiv
line.new(x1=prevFishHighBar, y1=prevFishHighVal, x2=pivotBarH, y2=fishPH, color=#EF5350, width=2, style=line.style_solid)
if priceAtHigh < prevPriceAtHigh and fishPH > prevFishHighVal
hidBearDiv := true
if showDiv
line.new(x1=prevFishHighBar, y1=prevFishHighVal, x2=pivotBarH, y2=fishPH, color=color.new(#EF5350, 30), width=2, style=line.style_dashed)
prevFishHighVal := fishPH
prevFishHighBar := pivotBarH
prevPriceAtHigh := priceAtHigh
// EARLY REVERSAL SIGNALS
fishCurlUp = fish > fish[1] and fish[1] <= fish[2]
fishCurlDown = fish < fish[1] and fish[1] >= fish[2]
earlyBullRaw = showEarly and fish[1] <= osLevel and fishCurlUp
earlyBearRaw = showEarly and fish[1] >= obLevel and fishCurlDown
var int lastEarlyBullBar = na
var int lastEarlyBearBar = na
earlyBull = earlyBullRaw and (na(lastEarlyBullBar) or (bar_index - lastEarlyBullBar) >= cooldownB)
earlyBear = earlyBearRaw and (na(lastEarlyBearBar) or (bar_index - lastEarlyBearBar) >= cooldownB)
if earlyBull
lastEarlyBullBar := bar_index
if earlyBear
lastEarlyBearBar := bar_index
// PLOTTING
fishColor = fish >= 0 ? #26A69A : #EF5350
plot(fish, title="Fisher", color=fishColor, linewidth=2)
plot(trigger, title="Trigger", color=#787B86, linewidth=1)
hline(0, title="Zero Line", color=#787B86, linestyle=hline.style_dashed)
hline(obLevel, title="Overbought", color=color.new(#EF5350, 60), linestyle=hline.style_dotted)
hline(osLevel, title="Oversold", color=color.new(#26A69A, 60), linestyle=hline.style_dotted)
plotshape(longCross, title="Long Crossover", style=shape.triangleup, location=location.bottom, color=#26A69A, size=size.tiny)
plotshape(shortCross, title="Short Crossover", style=shape.triangledown, location=location.top, color=#EF5350, size=size.tiny)
// PIVOT DIVERGENCE LABELS
plotshape(showDiv and regBullDiv, title="Regular Bullish Divergence", style=shape.labelup, location=location.bottom, color=#26A69A, text="RegBull", textcolor=color.white, size=size.small, offset=-pivR)
plotshape(showDiv and hidBullDiv, title="Hidden Bullish Divergence", style=shape.labelup, location=location.bottom, color=color.new(#26A69A, 30), text="HidBull", textcolor=color.white, size=size.small, offset=-pivR)
plotshape(showDiv and regBearDiv, title="Regular Bearish Divergence", style=shape.labeldown, location=location.top, color=#EF5350, text="RegBear", textcolor=color.white, size=size.small, offset=-pivR)
plotshape(showDiv and hidBearDiv, title="Hidden Bearish Divergence", style=shape.labeldown, location=location.top, color=color.new(#EF5350, 30), text="HidBear", textcolor=color.white, size=size.small, offset=-pivR)
plotshape(earlyBull, title="Early Bullish Reversal", style=shape.diamond, location=location.bottom, color=#00E5FF, size=size.tiny)
plotshape(earlyBear, title="Early Bearish Reversal", style=shape.diamond, location=location.top, color=#FF6D00, size=size.tiny)
// ALERTS
alertcondition(longCross, title="Fisher Long Crossover", message="Chaikin-Fisher: Long crossover")
alertcondition(shortCross, title="Fisher Short Crossover", message="Chaikin-Fisher: Short crossover")
alertcondition(regBullDiv, title="Regular Bullish Divergence", message="Chaikin-Fisher: Regular bullish divergence")
alertcondition(regBearDiv, title="Regular Bearish Divergence", message="Chaikin-Fisher: Regular bearish divergence")
alertcondition(hidBullDiv, title="Hidden Bullish Divergence", message="Chaikin-Fisher: Hidden bullish divergence")
alertcondition(hidBearDiv, title="Hidden Bearish Divergence", message="Chaikin-Fisher: Hidden bearish divergence")
alertcondition(earlyBull, title="Early Bullish Reversal", message="Chaikin-Fisher: Early bullish reversal signal")
alertcondition(earlyBear, title="Early Bearish Reversal", message="Chaikin-Fisher: Early bearish reversal signal")
Overview
Chaikin Fisher Transform Divergence & Early Reversal plots the resulting transformed oscillator, signal trigger line, and overbought/oversold levels in a separate pane. The script automatically detects regular and hidden bullish and bearish divergences between price and the oscillator using pivot points, plotting connecting trendlines once confirmed. Additionally, it provides early reversal signals with a configurable cooldown period. Key settings control moving average lengths, Fisher normalization periods, pivot lookback distances, and signal display toggles.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Fast Length
int
3
shortLen
Slow Length
int
10
longLen
Fisher Normalization Length
int
10
fishLen
Overbought Level
float
1.5
obLevel
Oversold Level
float
-1.5
osLevel
Show Divergences
bool
true
showDiv
Pivot Left Bars
int
4
pivL
Pivot Right Bars
int
4
pivR
Max Bars Between Pivots
int
60
maxPivBars
Show Early Reversal Signals
bool
true
showEarly
Signal Cooldown (Bars)
int
5
cooldownB
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.
Oscillator Suite plots a normalised price oscillator in a separate pane and overlays a signal line that can use SMA, EMA, WMA, HMA, RMA, VWMA, T3, ZEMA, KAMA, or GKEMA. It marks bullish and bearish divergences, a smoothed money-flow series, confluence areas an
This indicator plots the Money Flow Index in a separate pane and marks regular and hidden bullish and bearish divergences between price pivots and the oscillator. It builds the index from positive and negative money flow, then finds pivot highs and lows using
This indicator plots a smoothed Z-score of cumulative volume delta in a separate pane, showing whether buying or selling pressure is dominant and when the reading enters extreme zones. It marks spot accumulation, climax or exhaustion, and pivot-based price-vol
QPulse is a multi-factor indicator that draws in a separate pane to evaluate market momentum, volume flow, and volatility dynamics. It calculates volume delta, a cumulative delta proxy, advanced adaptive ATR, and a hybrid volume-weighted RSI with overbought an
This indicator plots a heuristic volume-balance oscillator in a separate pane. It estimates signed volume from the close location inside each bar, multiplies that by volume, and sums the proxy over a rolling window. The sum is scaled between minus one and plus
This indicator is an oscillator suite inspired by Market Cipher B and VuManChu Cipher B that plots in a separate pane. It combines a WaveTrend oscillator, a Money Flow Index (MFI) area, and an RSI indicator with automatic divergence detection. Visual signals h