All indicators

Center of Gravity

By LuxAlgoJun 23, 2026

Static chart image

Center of Gravity plots the balance point of a rolling price window as an oscillator: each bar's price is weighted by its position, the newest counting 1 and the oldest N, and the negated ratio of the weighted sum to the plain sum is the window's centroid in bar positions. This is the definitive clean build of Ehlers's Center of Gravity, paired with its standard trigger — the same line delayed one bar — whose crossings supply the entire signal grammar.

How to Trade the Center of Gravity?

  • Cross above the trigger: a cycle-trough cue, strongest when it fires near the bottom of the oscillator's recent envelope.
  • Cross below the trigger: a crest cue, read the same way near the top of the envelope.
  • No fixed bounds: the line carries no universal overbought or oversold levels, so stretch is sized against the oscillator's own recent travel.
  • Pinning: one color hugging one side of the pane means a persistent trend is loading the window — the cue to stand the counter-trend crossings down.

The tool is a cycle instrument: it earns its keep while price ranges and misleads while price trends, which is exactly the behavior the coloring makes visible.

Center of Gravity Settings

  • Length (default 10): the window N whose balance point is measured — the only parameter. The oscillator behaves best near half the dominant cycle length.
  • Source (default hl2): the price series in the window; the original construction uses the high-low midpoint.
  • Center on Zero (default on): adds the (N + 1) / 2 offset so the line swings around zero; disabled, the raw centroid rests near -(N + 1) / 2 and the midline follows.
  • Style: bullish, bearish, trigger, and midline colors, Gradient Fill (default on), and Trigger Cross Markers (default off) — the crossing alerts fire either way.

Frequently Asked Questions

How does it compare with the Fisher Transform?

Both are Ehlers cycle tools read through a one-bar trigger. The Fisher Transform reshapes normalized price so extremes become sharp turning points; the Center of Gravity tracks the window's centroid instead, giving a smoother line with gentler turns.

What Length should I use?

The default 10 matches the published examples. Half the dominant cycle you trade is the guideline: shorter windows turn faster and whip more, longer ones smooth the line and delay every crossing.

Why does the oscillator sit near a negative level instead of zero?

Center on Zero is off. The raw centroid of flat prices rests at -(N + 1) / 2 — around -5.5 at the default length — and the centering option simply re-bases that resting level to zero. Both conventions plot the same information.

Original indicatorBuilt in-house by LuxAlgo

The Library is free. Quant makes it yours.

Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.