Deviation Scaled Moving Average
Oct 6, 2018

The Deviation Scaled Moving Average indicator provides a volatility-adaptive smoothing mechanism designed to track price trends with minimal lag by dynamically adjusting its sensitivity based on price deviations.
Usage
The Deviation Scaled Moving Average (DSMA) is primarily used to identify trend direction and potential reversal points through the interaction of two separate DSMA lines with different lookback periods.
- Trend Identification: When the shorter-period DSMA (default 40) is above the longer-period DSMA (default 100), the trend is considered bullish. Conversely, when the shorter DSMA is below the longer one, the trend is considered bearish.
- Crossover Signals: Traders often look for crossovers between the two lines as entry or exit signals. A "Golden Cross" occurs when the fast DSMA crosses above the slow DSMA, suggesting a buying opportunity. A "Death Cross" occurs when the fast DSMA crosses below the slow DSMA, suggesting a selling opportunity.
- Volatility Adaptation: Because the script scales its alpha (smoothing factor) based on price deviation, the lines will track price more closely during high-volatility moves and flatten out during sideways consolidation.
Details
Developed by John Ehlers, the DSMA concept aims to solve the trade-off between lag and smoothness found in traditional moving averages. The implementation involves several technical stages:
- Preprocessing: The script calculates a "zeros" value (current price minus price two bars ago) to eliminate DC offsets.
- SuperSmoother Filter: This value is passed through a 2-pole SuperSmoother filter to remove high-frequency noise.
- RMS Scaling: The Root Mean Square (RMS) of the filtered signal is calculated over the user-defined period.
- Adaptive Alpha: The filtered signal is divided by its RMS to create a scaled filter. The absolute value of this scaled filter determines the alpha (weighting) used in the final exponential moving average calculation.
This architecture ensures that when price moves significantly (high deviation), the alpha increases to reduce lag. When price movement is negligible, the alpha decreases to increase smoothing.
Settings
- Period 1: Sets the lookback period for the first (typically faster) DSMA. This affects the smoothing and the RMS calculation for the first line.
- Period 2: Sets the lookback period for the second (typically slower) DSMA. This defines the baseline for the longer-term trend.
FAQ
What makes DSMA different from a standard EMA? While a standard Exponential Moving Average (EMA) uses a fixed multiplier, the DSMA uses an adaptive alpha that changes every bar based on the volatility of the filtered price, allowing it to react faster to sharp moves while remaining smooth during low volatility.
Can I change the colors of the DSMA lines? Yes, the colors and line styles can be adjusted within the Style tab of the indicator settings to suit different chart backgrounds or preferences.
How do I access the Deviation Scaled Moving Average? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
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.

