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)
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。