Center of Gravity is a oscillator type of indicator. It is formed by mean of weighted moving averages. It has lesser lag than other moving average indicators. A Center of Gravity indicator can be used for
1. Generating buy sell signals
2. Marking support and resistance zones
3. Finding possibility of turning point through divergence.
How to use Center of Gravity Indicator
Method 1 : Any momentum or oscillator type of indicator can be used by creating a signal line by taking average of indicator value. Say, if I create a Centre of Gravity indicator with 10 periods than I can take a 3 or 5 days average of the indicator value to create a more smooth line to act as a signal line.
Below is the code for creating COG with 10 period and signal line with 5 period.
//@version=4 study("implementing COG indicator") cog_value = cog(close,10) cog_avg =sma(cog_value,5) plot(cog_value) plot(cog_avg,color=color.red) |
Here is the output generated by the code. You can always adjust the value of signal line to suit your requirement and better identification of buy/sell signals.
Resources
Learn more on COG, coding and other technical indicators in PineScript through Books on pinescript available on amazon and kindle.
200+ pages book | 100 pages book |