HPotter

CMO Oscillator with Filter

Hi
Let me introduce my CMO Oscillator with Filter script.
This indicator plots a CMO which ignores price changes which are less
than a threshold value. CMO was developed by Tushar Chande. A scientist,
an inventor, and a respected trading system developer, Mr. Chande developed
the CMO to capture what he calls "pure momentum". For more definitive
information on the CMO and other indicators we recommend the book The New
Technical Trader by Tushar Chande and Stanley Kroll.
The CMO is closely related to, yet unique from, other momentum oriented
indicators such as Relative Strength Index, Stochastic, Rate-of-Change, etc.
It is most closely related to Welles Wilder`s RSI, yet it differs in several ways:
- It uses data for both up days and down days in the numerator, thereby directly
measuring momentum;
- The calculations are applied on unsmoothed data. Therefore, short-term extreme
movements in price are not hidden. Once calculated, smoothing can be applied to the
CMO, if desired;
- The scale is bounded between +100 and -100, thereby allowing you to clearly see
changes in net momentum using the 0 level. The bounded scale also allows you to
conveniently compare values across different securities.

Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 19/04/2014
// This indicator plots a CMO which ignores price changes which are less 
// than a threshold value. CMO was developed by Tushar Chande. A scientist, 
// an inventor, and a respected trading system developer, Mr. Chande developed 
// the CMO to capture what he calls "pure momentum". For more definitive 
// information on the CMO and other indicators we recommend the book The New 
// Technical Trader by Tushar Chande and Stanley Kroll.
// The CMO is closely related to, yet unique from, other momentum oriented 
// indicators such as Relative Strength Index, Stochastic, Rate-of-Change, etc. 
// It is most closely related to Welles Wilder`s RSI, yet it differs in several ways:
// - It uses data for both up days and down days in the numerator, thereby directly 
// measuring momentum;
// - The calculations are applied on unsmoothed data. Therefore, short-term extreme 
// movements in price are not hidden. Once calculated, smoothing can be applied to the 
// CMO, if desired;
// - The scale is bounded between +100 and -100, thereby allowing you to clearly see 
// changes in net momentum using the 0 level. The bounded scale also allows you to 
// conveniently compare values across different securities.
////////////////////////////////////////////////////////////
fFilter(xSeriesSum, xSeriesV, Filter) =>
    iff(xSeriesV > Filter, xSeriesSum, 0)

study(title="CMOfilt", shorttitle="CMOfilt")
Length = input(9, minval=1)
Filter = input(3, minval=1)
TopBand = input(70, minval=1)
LowBand = input(-70, maxval=-1)
hline(0, color=gray, linestyle=line)
hline(TopBand, color=red, linestyle=line)
hline(LowBand, color=green, linestyle=line)
xMom = close - close[1]
xMomAbs = abs(close - close[1])
xMomFilter = fFilter(xMom, xMomAbs, Filter)
xMomAbsFilter = fFilter(xMomAbs,xMomAbs, Filter)
nSum = sum(xMomFilter, Length)
nAbsSum = sum(xMomAbsFilter, Length)
nRes =   100 * nSum / nAbsSum
plot(nRes, color=blue, title="CMOfilt")