indicator · own pane · open source
Chaikin Money Flow
Running…
Loading chart…
About
Chaikin Money Flow is the ratio of accumulation-flow volume to total volume over the lookback — bounded around zero, with +0.2 and -0.2 as common signal thresholds.
- Sustained CMF > 0.2 = strong accumulation.
- Sustained CMF < -0.2 = strong distribution; rallies on the failed CMF tend to die fast.
Source code
//@version=5
indicator("Chaikin Money Flow", overlay=false)
len = input.int(20, "Length", minval=2, maxval=200)
mfm = high == low ? 0.0 : ((close - low) - (high - close)) / (high - low)
mfv = mfm * volume
cmf = ta.sma(mfv, len) / ta.sma(volume, len)
hline(0.2, "Strong buy", color=color.green)
hline(-0.2, "Strong sell", color=color.red)
hline(0, "Zero", color=color.gray)
p_CMF = plot(cmf, "CMF", color=color.orange, linewidth=2)
alertcondition(ta.crossover(cmf, 0.2), "CMF bullish", "CMF crossed above 0.2 — strong accumulation")
alertcondition(ta.crossunder(cmf, -0.2), "CMF bearish", "CMF crossed below -0.2 — strong distribution")
No comments yet.
Sign in to comment.