Loading…

Ehlers Center Of Gravity

Most oscillators are built from an average, which is exactly what causes their lag: an average cannot register a turn until enough new bars have entered the window to outweigh the old trend. Ehlers' Center of Gravity takes a different starting point entirely - it treats the last N median prices as physical weights arranged along a beam and solves for where that beam would balance, the same calculation used for a real mechanical center of gravity. Because the calculation is a balance point rather than a running average, it turns at genuine price extremes with very little lag, and it stays roughly bounded by the window's own price range without needing any separate normalisation step. Ehlers' own published reading uses the CG value together with itself delayed by one bar as a signal/trigger pair - a crossover between the two is the entry signal his article describes, functioning like a very fast, low-lag stochastic-style cross without stochastic's boxed 0-100 scaling. Notes and limitations - Uses the median price (High+Low)/2 for the balance-point weights, as in Ehlers' original article, not the close alone. - The oscillator's natural centre is not exactly zero by construction - Ehlers' own formula folds in a (Period+1)/2 offset so a perfectly flat price series reads at zero rather than at an arbitrary negative baseline; this is the published formula, not an approximation. - Like any short-window balance-point calculation, it is more sensitive to a single outlier bar than a longer moving average would be - a sharp one-bar spike briefly pulls the balance point toward it. - Never repaints: every plotted value for a closed bar is final.

Indicator · MT4 · v1.0 · Free

About Ehlers Center Of Gravity

Ehlers Center Of Gravity is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Period and Alerts. MQL source code included.

Files in the download: EhlersCenterOfGravity.ex4, EhlersCenterOfGravity.mq4, EhlersCenterOfGravity.txt.

Settings

SettingDefaultWhat it does
Period10Number of bars in the balance-point window
AlertstrueAlert once per closed bar when CoG crosses its Signal line

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Oscillator · Buy/Sell Arrows · Trend · Alerts · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria