Monday, May 10, 2021

# Center of Gravity

Real author:

Rosh

Center of Gravity actually has a zero lag and allows to define turning points precisely. This indicator is the result of Ehler’s study of adaptive filters.

The indicator Center of Gravity allows to identify main pivot points almost without any lag.

The idea of calculating a center of gravity appeared from the investigation of lags of different filters with the finite impulse response (FIR) in accordance with the relative amplitude of filter coefficients. SMA (Simple Moving Average) is a FIR-filter, in which all coefficients have one and the same value. As a result the center of gravity of SMA is an exact center of the filter. WMA (Weighted Moving Average) is a FIR-filter, in which the last price change is weighted through the filter length, and so on.

The values of weighting are coefficients of filters. Coefficients of WMA filters can be presented as contours of a triangle. The center of gravity is on the 1/3 of the triangle base length. Thus WMA gravity center is shifted to the right with respect to the center of gravitation of SMA of the same length, which gives us a smaller lag. For all examples with FIR filters the sum of productions of coefficients and the price must be divided by the sum of coefficients for preservation of original prices.

The most famous of such FIR filters is Ehlers filter that can be presented the following way:

The quote from the article:

“The coefficients of the Ehlers Filter can be almost any measure of variability. I have looked at momentum, signal to noise ratio, volatility, and even Stochastics and RSI values as filter coefficients. One of the most adaptive set of coefficients arose from video edge detection filters, and was the sum of the square of the differences of each price to each previous price. In any event, the result of using different filter coefficients is to make the filter adaptive by moving the CG of the coefficients.

While I was debugging the code of an adaptive FIR filter I noticed that the CG, itself, moved in exact opposition to the price swings. The CG moves to the right when prices go up and moves to the left when prices go down. Measured as the distance from the most recent price, the CG decreased when prices rose and increased when they fell. All I had to do was to invert the sign of the CG to get a smoothed oscillator that was both in phase with the price swings and had essentially zero lag.”

The Center of Gravity is calculated as Ehlers filter using the formula:

In this indicator Period_ parameter sets the period for the indicator calculation, AppliedPrice parameter sets the price type, based on which the indicator is calculated – thus we get the main line of the indicator (with changing color).

For the signal line (blue dot-dash line) the SmoothPeriod parameter sets the period of smoothing the main indicator line, the SmoothType parameter denotes the type of smoothing. The interpretation of the values of parameters is given in the form of comments in the indicator code.

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”.

This indicator was first implemented in MQL4 and published in CodeBase 20.02.2007.

### HOW TO INSTALL METATRADER INDICATORS ON MT5

Installing indicators on MT5 comes down to:

2. Placing them in the MT5 “Indicators” Data Folder
3. Closing and re-starting your MT5 terminal
4. Dragging you indicator from the Navigator to the Forex Chart

Download and prepare the MT5 indicator file(s) so they are ready to go on your computer. (Please note that some custom indicators will come in a .rar file, so make sure to extract the .ex5 and .mq5 files).

Go back to your Metatrader 5 platform, click the File Tab and select “Open Data Folder” to get access to the system folders for the MT5 program:

### Placing them in the MT5 “Indicators” Data Folder.

Go to the “MQL5” folder and the “Indicator” subfolder and open the folder.

Drag or copy and paste the custom indicators files to the “Indicators” subfolder.

Go to the navigation window and scroll down the menu to “Indicators”, pick the one you want to use and drag it to your chart.

Peppperstone is an award winning broker with a No Dealing Desk, Pure ECN model. Their cutting edge technology coupled with pricing from 22 Tier 1 banks ensures that traders will receive the fastest execution at the most competitive pricing available.

### Regulation

Pepperstone is authorized to do business in many different countries around the world.  The two main regulatory bodies that are responsible for oversight of Pepperstone’s operations is the Australia Securities and Investment Commission (ASIC) and UK’s Financial Conduct Authority (FCA).

There are two primary choices of trading platforms that Pepperstone supports. The first is the industry standard Metatrader platform and the second is the ECN based cTrader platform.

Pepperstone offers 100+ trading interments, with a primary specialization in Forex and CFDs (Contracts for Difference).  There are over 70 currency pairs available to trade, everything from the majors, to the minors and exotic pairs. With access to the interbank market for razor thin dealing spreads starting at 0 pips, forex traders will find Pepperstone to an excellent choice.

As an ECN broker, Pepperstone offers extremely tight dealing spreads. The actual trading cost will depend on the type of account chosen. Pepperstone offers two primary account types – Razor Account and the Standard Account. The Razor Account is a true ECN based broker account with Interbank pricing and a commission charged to the trader.

.

.

MetatraderIndicators.com was developed by Forex traders for traders. We wasted hours, probably years, looking for indicators, software and Forex broker reviews. Metatraderindicators.com is a hub for technical traders. It represents years of work, knowledge and experience. Enjoy and stay true to your passion.
79Fans
0Followers
0Subscribers

### Pepperstone

Automated page speed optimizations for fast site performance