Discussion about this post

User's avatar
deeptendies's avatar

On-Chain is this indicator part of the monthly subcription ?

Cheers

Satoshi Signals's avatar

I just tried to make a similar indicator using your blog.

//@version=5

indicator("Bull Momentum Gauge (Fixed)", overlay=true)

// === INPUTS ===

maLength = input.int(365, title="MA Period (days)")

zmaLength = input.int(200, title="Z-score MA Period")

src = close

// === CALCULATE Z-SCORE ===

ma = ta.sma(src, maLength)

stdev = ta.stdev(src, maLength)

zscore = (src - ma) / stdev // Not inverted

// === SIGNAL LINE ===

zscore_ma = ta.sma(zscore, zmaLength)

// === ENTRY LOGIC ===

bullish = zscore > zscore_ma

bearish = zscore < zscore_ma

// === PLOT SIGNAL BACKGROUND ===

bgcolor(bullish ? color.new(color.green, 85) : bearish ? color.new(color.red, 85) : na)

// === PLOT SIGNAL MARKERS ===

plotshape(bullish and not bullish[1], title="BUY", location=location.belowbar, style=shape.labelup, color=color.green, text="BUY")

plotshape(bearish and not bearish[1], title="EXIT", location=location.abovebar, style=shape.labeldown, color=color.red, text="EXIT")

// === DEBUG PLOT ===

showZ = input.bool(false, title="Show Z-score Plot")

plot(showZ ? zscore : na, title="Z-score", color=color.blue)

plot(showZ ? zscore_ma : na, title="Z-score MA", color=color.orange)

18 more comments...

No posts

Ready for more?