Moving Average Oscillator by
Sep 16, 2021

The Moving Average Oscillator [DM] indicator is a versatile technical analysis tool that visualizes momentum by calculating the difference between a main price source and multiple moving average lengths, similar to a MACD but with an expanded multi-period framework. By consolidating multiple moving average signals into a single oscillator, it allows traders to identify trends and mean reversion opportunities without cluttering the price chart.
Usage
The Usage section focuses on interpreting the oscillator's distance from the zero line and its various components. The script offers a comprehensive view of momentum across nine different moving average lengths, which are aggregated to provide a "Signal Average."
- Trend Identification: When the oscillator is above zero, it indicates bullish momentum; below zero indicates bearish momentum. The "Signal Average" (AVG) provides a smoothed representation of the overall trend.
- Mean Reversion and Squeeze: The script incorporates Bollinger Bands to identify "squeezes" (low volatility periods) and high-value reversions. Users can adjust the squeeze and reversion sensibility to find potential breakout or exhaustion points.
- Visual Customization: Users can toggle between showing all individual MA signals or just the aggregate average. Gradient coloring can be enabled to highlight the strength of the trend based on the rate of change in the oscillator values.
- Alert Configuration: Alerts can be customized based on crossovers between specific MA signals (e.g., the 8-period vs. the 21-period) or between a signal and the zero line.
Details
The indicator is constructed by calculating the difference between the source price and a series of Exponential Moving Averages (EMAs). This process effectively transforms trend-following data into an oscillator format.
Key implementation details include:
- Multi-MA Framework: It utilizes lengths typically following Fibonacci sequences (8, 13, 21, 34, 55, 89, 144, 233) to provide a broad perspective on momentum.
- Normalization: The levels are graduated using a single parameter ("Levels Bandwidth"), allowing the horizontal axis to scale dynamically to the asset's volatility.
- Resolution Handling: The script includes security functions to handle custom timeframes and optional repainting settings for real-time calculation adjustments.
Settings
Source settings
- Resolution: Sets the timeframe for the indicator calculations.
- Allow Repainting: Toggles the security function's behavior for historical vs. real-time data.
- Main Source: Determines the price input (Close, Open, HL2, etc.) used for the calculations.
- Offset Plot: Shifts the oscillator plots forward or backward in time.
Alert condition
- Active alerts?: Master switch to enable or disable programmed alerts.
- Active squeeze alerts?: Enables alerts specifically for Bollinger Band squeeze conditions.
- Squeeze sensibility: Adjusts the threshold for what constitutes a volatility squeeze.
- H.V.Reversion sensibility: Adjusts the threshold for high-value mean reversion signals.
- First/Second source signal: Defines which MA lengths (or the Average) are used for crossover alert logic.
Options
- Show all plots: Toggles the visibility of all nine individual MA signals.
- Show all hlines: Toggles the visibility of horizontal level markers.
- Allow bar color condition: Changes the chart's candle colors based on oscillator momentum.
- Use gradient colors: Enables smooth color transitions for plots and fills based on trend strength.
MA Lengths
- MA Length #05 - #233: Individual inputs to customize the periods for each of the nine moving averages used in the oscillator.
FAQ
How do I interpret the different colors in the oscillator? If gradient colors are enabled, strong green/red indicates accelerating momentum, while weaker shades suggest a potential slowing or consolidation in the trend.
What is the purpose of the horizontal levels? The horizontal levels serve as overbought or oversold markers, helping traders identify when the price has moved significantly away from its average and may be due for a correction.
How can I access this indicator? 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.