Back to Docs
Traderoid

COG Pass

Centre of Gravity Oscillator — Series Input

IndicatorTrendOverlay

Overview

COG Pass applies John Ehlers's Centre of Gravity oscillator to any upstream numeric series. It measures where price "mass" is concentrated within a rolling window, producing a near-zero-lag oscillator useful for identifying turning points.

Formula

COG[t] = −Σ(x[t−i]·(i+1)) / Σ x[t−i] for i = 0..period−1

Parameters

ParameterTypeDefaultDescription
periodnumber10Window length in bars.

Inputs & Outputs

PortDirectionTypeDescription
inputInput(number | null)[]Any numeric series (values + timestamps).
valuesOutput(number | null)[]Smoothed output series, null for warm-up bars.
timestampsOutputnumber[]Bar timestamps aligned with values.