The Twiggs Money Flow indicator was posted earlier but I thought to add my variation to the library as well, since the normalization process might add value.
The normalization process I use is what John Bollinger describes in his book – take the average of the indicator, create two bands based on the standard deviation and express the indicator as to where it is inside the bands. The question the normalization answers is “where inside the frequency distribution is my indicator value?” You can change the parameters and the overbought/oversold criteria. Above 100 would mean that your Twiggs Money Flow is above 2 standard deviations of the average and below 0 would mean that your Twiggs Money Flow is below 2 standard deviations of the average. The center line is the average. I find that it trades divergence well. Below is my code:
//Calculate Twiggs Money Flow
TRL = min(low, close[1])
TRH = max(high, close[1])
BuySellPressure = ((close - TRL) - (TRH - close))
TrueRange = (TRH - TRL)
MF = (BuySellPressure / TrueRange) * volume
//Express volume as fraction of total volume
TotalMF = exponentialaverage[20](MF)
TotalVolume = exponentialaverage[20](Volume)
FinalMF = TotalMF / TotalVolume
//Normalize Twiggs Money Flow
//Generic normalization process
Indicator = FinalMF
AverageIndicator = average[200](Indicator)
StandardDeviation = STD[200](Indicator)
UpperBand = AverageIndicator + (2 * StandardDeviation)
LowerBand = AverageIndicator - (2 * StandardDeviation)
NormalizedIndicator = ((Indicator - LowerBand) / (UpperBand - LowerBand)) * 100
Overbought = 100
Center = 50
Oversold = 0
Return NormalizedIndicator as "Normalized Twiggs", Overbought as "Overbought", Oversold as "Oversold", Center as "Center"