indicator · own pane · open source
Twiggs Money Flow
Running…
Loading chart…
About
Twiggs Money Flow is the smoothed A/D ratio — Colin Twiggs' answer to Chaikin MF with a 21-period default that emphasises the bigger picture.
- Above zero = accumulation holding; below = distribution.
- A break of the zero line often coincides with the larger trend change.
Source code
//@version=5
indicator("Twiggs Money Flow", overlay=false)
len = input.int(21, "SMA length", minval=2, maxval=200)
mfm = close == high and close == low or high == low ? 0.0 : ((close - low) - (high - close)) / (high - low)
tmf = ta.sma(mfm * volume, len) / ta.sma(volume, len)
hline(0, "Zero", color=color.gray)
p_TMF = plot(tmf, "TMF", color=color.purple, linewidth=2)
alertcondition(ta.crossover(tmf, 0), "TMF bullish", "Twiggs Money Flow crossed above zero")
alertcondition(ta.crossunder(tmf, 0), "TMF bearish", "Twiggs Money Flow crossed below zero")
No comments yet.
Sign in to comment.