Indicator · Pine Script v6 · Own pane

Chaikin Fisher Transform Divergence & Early Reversal

by theonetrade

This indicator calculates a Fisher Transform applied to the Chaikin Oscillator, which is derived from volume Accumulation/Distribution.

View on GitHub

GitHub stars34on the repository
Pine versionv6current
Lines of code151
Settings11inputs
LicenceMIT
Last update2 weeks ago8 Nov 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

151 lines of Pine Script v6 from assets/indicator/bit-exact/chaikin_fisher_transform_divergence_early_reversal_RWPqmGCy.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

chaikin_fisher_transform_divergence_early_reversal_RWPqmGCy.pine
//@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.

Details

Published by

theonetrade on GitHub

Draws

Separate pane below the chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

algorithmic-tradingbacktestingbitcoinccxtcrypto-tradingllm-agentoffline-backtestingopen-source-tradingpine-scriptpine-to-pythonpinescriptpynecorepythonquantquantitative-financestrategy-backtestingtechnical-analysistrading-indicatorstrading-strategiestradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Fast Lengthint3shortLen
Slow Lengthint10longLen
Fisher Normalization Lengthint10fishLen
Overbought Levelfloat1.5obLevel
Oversold Levelfloat-1.5osLevel
Show DivergencesbooltrueshowDiv
Pivot Left Barsint4pivL
Pivot Right Barsint4pivR
Max Bars Between Pivotsint60maxPivBars
Show Early Reversal SignalsbooltrueshowEarly
Signal Cooldown (Bars)int5cooldownB
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.

Similar Pine Scripts

Oscillator Suite

by TamaraKGreen
47 stars

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

Indicator v5 Oscillators & momentumDivergence
Updated 2 months ago · None stated GitHub repository of Oscillator Suite

MFI Divergences

by tistaharahap
25 stars

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

Indicator v4 Oscillators & momentumVolume
Updated 6 years ago · None stated GitHub repository of MFI Divergences
11 stars

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

Indicator v6 Oscillators & momentumVolume Repaints
Updated 2 months ago · MIT GitHub repository of CVD Z-Score [NeuNue]

QPulse

by JasonTeixeira
11 stars

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

Indicator v6 Oscillators & momentumVolatility & bands
Updated 5 weeks ago · Custom licence GitHub repository of QPulse
9 stars

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

Indicator v6 VolumeOscillators & momentum
Updated 4 weeks ago · MIT GitHub repository of CVD Bias [WavesUnchained]

DC-B v2.5

by crissrocca
9 stars

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

Indicator v4 Oscillators & momentumDivergence
Updated 3 years ago · MPL-2.0 GitHub repository of DC-B v2.5

More Oscillators & momentum scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers