HPotter

CMOabsav

Hi
Let me introduce my CMOabsav Oscillator script.
This indicator plots the absolute value of CMO averaged over three
different lengths. This indicator plots a classical-looking oscillator,
which is really an averaged value based on three different periods.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 18/04/2014
//    This indicator plots the absolute value of CMO averaged over three 
//    different lengths. This indicator plots a classical-looking oscillator, 
//    which is really an averaged value based on three different periods.
////////////////////////////////////////////////////////////
study(title="CMOabsav", shorttitle="CMOabsav")
Length1 = input(5, minval=1)
Length2 = input(10, minval=1)
Length3 = input(20, minval=1)
TopBand = input(70, minval=1)
LowBand = input(20, minval=0)
hline(0, color=green, linestyle=dashed)
hline(TopBand, color=purple, linestyle=line)
hline(LowBand, color=red, linestyle=line)
xMom = close - close[1]
xMomabs = abs(close - close[1])
nSum1 = sum(xMom, Length1)
nSumAbs1 = sum(xMomabs, Length1)
nSum2 = sum(xMom, Length2)
nSumAbs2 = sum(xMomabs, Length2)
nSum3 = sum(xMom, Length3)
nSumAbs3 = sum(xMomabs, Length3)
nRes = abs(100 * (nSum1 / nSumAbs1 + nSum2 / nSumAbs2 + nSum3 / nSumAbs3 ) / 3)
plot(nRes, color=blue, title="CMOabsav")