Ehlers Stochastic CG Oscillator

May 25, 2015

Static chart image
Signals
Oscillators

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 access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.