indicator · own pane · open source
Market Meanness Index
Running…
Loading chart…
About
Market Meanness Index (MMI) — ratio of the standard deviation of the price-vs-SMA distance to its mean absolute deviation. High MMI = trending (heavy tails), low MMI = mean-reverting (Gaussian).
- Use with a regime filter to switch between trend-following and mean-reversion strategies.
Source code
//@version=5
indicator("Market Meanness Index", overlay=false)
len = input.int(14, "Length", minval=5, maxval=100)
dist = close - ta.sma(close, len)
mmi = ta.stdev(dist, len) / math.max(ta.sma(math.abs(dist), len), 0.0001)
hline(1, "Gaussian", color=color.gray)
p_MMI = plot(mmi, "MMI", color=color.purple, linewidth=2)
alertcondition(mmi > 1.4, "Heavy tails", "MMI above 1.4 — heavy-tail / fat tails price")
alertcondition(mmi < 0.8, "Mean reverting", "MMI below 0.8 — mean-reverting regime")
No comments yet.
Sign in to comment.