indicator · own pane · open source
Mass Index indicator
Mass Index is a free open-source indicator. Mass Index sums the ratio of the smoothed range to its double-smoothing over a 25-bar… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Mass Index does
Mass Index sums the ratio of the smoothed range to its double-smoothing over a 25-bar window — designed to spot trend reversals via a range bulge.
- A bulge above 27.0 warns that the range is expanding fast; look for a reversal candle.
- Falling back below 26.5 after a bulge often marks the actual turn.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Mass Index", overlay=false)
len = input.int(25, "Sum length", minval=2, maxval=100)
eLen = input.int(9, "EMA length", minval=2, maxval=50)
colorBg = input.color("color.purple", "Color Bg")
colorDown = input.color("color.red", "Color Down")
colorUp = input.color("color.green", "Color Up")
e1 = ta.rma(high - low, eLen)
e2 = ta.rma(e1, eLen)
miX = e1 / e2
miSum = ta.cum(miX) - ta.cum(miX)[len]
mi = miSum
hline(27, "Bulge", color=colorDown)
hline(26.5, "Reset", color=colorUp)
p_MI = plot(mi, "MI", color=colorBg, linewidth=2)
alertcondition(ta.crossover(mi, 27), "Bulge", "Mass Index bulged above 27")
alertcondition(ta.crossunder(mi, 26.5), "Reset", "Mass Index reset below 26.5 — reversal candidate")
No comments yet.
Sign in to comment.