Ehlers Stochastic CG Oscillator
May 25, 2015

The Ehlers Stochastic CG Oscillator indicator provides a momentum-based oscillating signal by applying a stochastic calculation to the Center of Gravity (CG) oscillator to improve responsiveness to market cycles.
Usage
The Usage section describes how the script can be used to identify momentum shifts and potential reversal points. Similar to the Stochastic RSI, this tool oscillates between defined upper and lower bounds to highlight overbought and oversold conditions.
- Trend Identification: When the red Stochastic CG line is above the green trigger line, it indicates bullish momentum. Conversely, when the red line is below the green trigger line, it suggests bearish momentum.
- Mean Reversion: Users typically look for crossovers occurring near the overbought (positive) or oversold (negative) levels. A cross above the trigger line while in the oversold zone may signal a long opportunity, while a cross below the trigger line in the overbought zone may signal a short opportunity.
- Visual Analysis: The script includes an optional "Color bars" feature. When enabled, the chart candles will change color based on the relationship between the oscillator and its previous values, helping traders visualize trend strength directly on the price action.
Details
The construction of this indicator is based on John Ehlers' work in "Cybernetic Analysis for Stocks and Futures." The primary issue with standard stochastic oscillators is their reliance on a fixed lookback period, which often fails to adapt to shifting market cycle lengths.
The Stochastic CG Oscillator addresses this by first calculating the Center of Gravity (CG). The CG is a lead-lag indicator that identifies turning points with minimal lag by calculating the sum of prices multiplied by their position in the lookback window. By then applying a stochastic transformation to this CG value, the resulting oscillator becomes more reactive to price changes while remaining smoothed through a specialized 4-sample WMA (Weighted Moving Average) filter. The trigger line is a 1-period lagged version of this output, further smoothed to reduce market noise.
Settings
- Source: Determines the price data used for the calculation (default is hl2).
- Length: The lookback period used for both the Center of Gravity and the Stochastic calculation.
- OB/OS Level: Sets the horizontal threshold for overbought and oversold regions (default is 0.8 and -0.8).
- Fill Osc/Trigger region: Toggles the background shading between the oscillator and the trigger line for better visual clarity.
- Color bars?: When enabled, applies a color gradient to the price bars based on the oscillator's momentum and position relative to the zero line.
FAQ
How do I interpret the Stochastic CG Oscillator? The indicator is interpreted similarly to a standard Stochastic or RSI. Look for crossovers between the oscillator (red) and trigger (green) lines, especially when they occur outside the Overbought/Oversold levels defined in the settings.
What makes this different from a standard Stochastic? Unlike a standard stochastic that uses raw price, this version uses the Center of Gravity as its base input. This allows the indicator to stay more "in sync" with market cycles and react faster to pivot points without the lag typically associated with smoothing.
How can I access the Ehlers Stochastic CG Oscillator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.