OPEN-SOURCE SCRIPT
Fisher

//version=5
indicator("Fisher + EMA + Histogram (Working)", overlay=false)
// Inputs
fLen = input.int(125, "Fisher Length")
emaLen = input.int(21, "EMA Length")
src = input.source(close, "Source")
// Fisher Transform
var float x = na
minL = ta.lowest(src, fLen)
maxH = ta.highest(src, fLen)
rng = maxH - minL
val = rng != 0 ? (src - minL) / rng : 0.5
x := 0.33 * 2 * (val - 0.5) + 0.67 * nz(x[1])
x := math.max(math.min(x, 0.999), -0.999)
fish = 0.5 * math.log((1 + x) / (1 - x))
// EMA of Fisher
fishEma = ta.ema(fish, emaLen)
// Histogram
hist = fish - fishEma
histColor = hist >= 0 ? color.new(color.lime, 50) : color.new(color.red, 50)
plot(hist, style=plot.style_histogram, color=histColor, title="Histogram")
// Fisher Plot
fishColor = fish > 2 ? color.red : fish < -2 ? color.lime : color.teal
plot(fish, "Fisher", color=fishColor, linewidth=2)
plot(fishEma, "Fisher EMA", color=color.orange, linewidth=2)
// Horizontal Lines
hline(2, "Upper Extreme", color=color.new(color.red, 70))
hline(-2, "Lower Extreme", color=color.new(color.green, 70))
hline(0, "Zero", color=color.gray)
// Cross Signals
bull = ta.crossover(fish, fishEma)
bear = ta.crossunder(fish, fishEma)
plotshape(bull, style=shape.triangleup, location=location.bottom, color=color.lime, size=size.tiny)
plotshape(bear, style=shape.triangledown, location=location.top, color=color.red, size=size.tiny)
// Background for extremes
bgcolor(fish > 2 ? color.new(color.red, 80) : fish < -2 ? color.new(color.green, 80) : na)
indicator("Fisher + EMA + Histogram (Working)", overlay=false)
// Inputs
fLen = input.int(125, "Fisher Length")
emaLen = input.int(21, "EMA Length")
src = input.source(close, "Source")
// Fisher Transform
var float x = na
minL = ta.lowest(src, fLen)
maxH = ta.highest(src, fLen)
rng = maxH - minL
val = rng != 0 ? (src - minL) / rng : 0.5
x := 0.33 * 2 * (val - 0.5) + 0.67 * nz(x[1])
x := math.max(math.min(x, 0.999), -0.999)
fish = 0.5 * math.log((1 + x) / (1 - x))
// EMA of Fisher
fishEma = ta.ema(fish, emaLen)
// Histogram
hist = fish - fishEma
histColor = hist >= 0 ? color.new(color.lime, 50) : color.new(color.red, 50)
plot(hist, style=plot.style_histogram, color=histColor, title="Histogram")
// Fisher Plot
fishColor = fish > 2 ? color.red : fish < -2 ? color.lime : color.teal
plot(fish, "Fisher", color=fishColor, linewidth=2)
plot(fishEma, "Fisher EMA", color=color.orange, linewidth=2)
// Horizontal Lines
hline(2, "Upper Extreme", color=color.new(color.red, 70))
hline(-2, "Lower Extreme", color=color.new(color.green, 70))
hline(0, "Zero", color=color.gray)
// Cross Signals
bull = ta.crossover(fish, fishEma)
bear = ta.crossunder(fish, fishEma)
plotshape(bull, style=shape.triangleup, location=location.bottom, color=color.lime, size=size.tiny)
plotshape(bear, style=shape.triangledown, location=location.top, color=color.red, size=size.tiny)
// Background for extremes
bgcolor(fish > 2 ? color.new(color.red, 80) : fish < -2 ? color.new(color.green, 80) : na)
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.