MOMENTUM & OSCILLATORS

Center of gravity

A smooth oscillator that swings around the price's recent balance point.

spec id: coglength (default 10)

What does Center of gravity measure?

A smooth oscillator that swings around the price's recent balance point. It turns early, which is why traders use it to time entries inside a range.

How is Center of gravity calculated?

Over the last 10 closes, weight each one by how far back it sits, add them up and divide by the plain total — the balance point of the window — then flip the sign and centre it on the middle of the window.

Written by reading the engine’s real computation, not a textbook — where the two differ, the page describes what actually runs.

How do I use Center of gravity in a bot?

In the builder, add an indicator of type cog (parameters: length, default 10). Its value becomes an operand you can compare in any entry or exit rule. The engine grades the whole rule honestly: real fills, no look-ahead, half the history held back.

Related indicators

Or browse all 158 indicators in the full library.

Build a bot that trades on Center of gravity — the first backtest is free.

Run a free backtest