This indicator was created by E.Coppock and was first used back in 1960s. It was first published in Barron's magazine. The indicator wasn't created for some investment fund, but at the request of Episcopal Church for long-term investments.
Coppock(t) = EMA(w,t)[ROC(l,t) + ROC(s,t)]
This indicator is a Moving Average for 10-month sum of 14- and 11-month ROC indicators. A signal for opening a position appears after the indicator changes direction. You can also open long positions when the histogram crosses the zero level upwards, and short positions when downwards.
The author of «The Encyclopedia of Technical Market Indicators» recommended to use the 5-period Exponential Moving Average along with the Coppock indicator. If EMA escapes the histogram downwards, then you can sell, otherwise, you can buy.
input uint ROC1Period = 14; input uint ROC2Period = 11; input uint SmoothPeriod=3; // Signal line smoothing period input ENUM_MA_METHOD MA_Method_=MODE_SMA; // Signal line averaging method input Applied_price_ AppliedPrice=PRICE_CLOSE_;// Price constant
Indicator uses the СMoving_Average class of the SmoothAlgorithms.mqh library. Working with that class was described in details in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers".
Originally this indicator has been written in MQL4 and was first published in the Code Base on 03.06.2015.
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/13156
The CenterOfGravityOSMA indicator with the timeframe selection option available in the input parameters.CenterOfGravityOSMA
The Center of Gravity J. F. Ehlers indicator represented by a colored OSMA histogram.