Concept
Center of Gravity
Center of Gravity is a Momentum & Oscillators concept. The Library holds 3 implementations, each one a working definition you can pull into Quant.
Ehlers
Top Center of Gravity indicators
3 total
What is the Center of Gravity?
The Center of Gravity is John Ehlers's oscillator, published in 2002, that locates the balance point of recent prices. Over a fixed window it weights each bar's price by its position, counting the newest bar as one and the oldest as the window length, divides the sum of the weighted prices by the sum of the prices, and negates the result: the centroid of the window, expressed in bar positions. When rising prices load the front of the window, the centroid shifts toward the newest bars and the line turns up; when the oldest bars carry the weight, it turns down.
Because the output is the centroid of a finite window, a relative of windowed FIR smoothing, Ehlers argued it smooths price without the usual lag penalty, and the standard plot pairs the line with a one-bar-delayed copy of itself as a trigger. Two cautions: it is a cycle tool that pins to one side during persistent trends, and the same name is also used for an unrelated polynomial-regression channel drawn around price. This page covers the Ehlers oscillator.
How traders use it
- For swing-turn timing in ranges: crossings of the oscillator and its delayed trigger line mark cycle turns with little lag while price is oscillating rather than trending.
- Through the stochastic variant, which applies stochastic-style normalization to the centroid over a lookback so cycle extremes register at consistent levels.
- Gated by a regime filter: since trends keep the centroid displaced in one direction, most workflows suppress its counter-trend signals once a trend regime is detected.
Related concepts · Classic single-name oscillators
Concept family
Momentum & Oscillators
91 concepts mapped · 72 in the Library
Center of Gravity FAQ
How is the Center of Gravity oscillator calculated?
Over a fixed window of N bars, weight each price by its position, counting the newest bar as one and the oldest as N, sum the weighted prices, divide by the sum of the prices, and negate the result. That is the centroid, the balance point of the window's prices measured in bar positions. A one-bar-delayed copy of the line serves as the trigger for crossover signals. The window length is the only parameter, though some published versions add a constant offset to center the line on zero.
Does the Center of Gravity oscillator work in trends?
Poorly, by design. Ehlers built it for the cycling component of price: in a range it turns close to actual swing highs and lows, but in a persistent trend the centroid stays displaced in the trend's direction and the oscillator pins, producing early counter-trend signals. Pairing it with a trend or regime filter is the standard mitigation, not a guarantee.
Build Center of Gravity your way.
Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.


