All indicators

Deviation Scaled Moving Average w/ DSL

Sep 16, 2022

Static chart image
SignalsMoving AveragesVolatility

The Deviation Scaled Moving Average w/ DSL indicator provides an adaptive moving average that dynamically adjusts to price volatility and utilizes Discontinued Signal Lines (DSL) to generate trend reversal signals.

Usage

The Usage section describes how the script can be used to identify trend changes and volatility-adjusted price movements. Users can interpret the indicator based on the relationship between the adaptive average and its signal levels.

  • Trend Identification: When the price is above the upper DSL level and the average is colored green, a bullish trend is indicated. Conversely, when the price is below the lower DSL level and the average is colored red, a bearish trend is indicated.
  • Signal Types: The script supports two primary signal methods:
    • Slope: Signals are based on the relationship between the current output and its previous value (momentum).
    • Level Crosses: Signals are generated when the adaptive average crosses the dynamic DSL levels.
  • Visual Cues: The script provides on-chart shapes ("L" for Long and "S" for Short) and optional bar coloring to highlight market state changes.

Details

The Deviation Scaled Moving Average (DSMA) was originally described in the July 2018 issue of Technical Analysis of Stocks & Commodities (TASC). It functions by scaling the smoothing factor based on a Root Mean Square (RMS) calculation of price changes, allowing it to stay close to the price during high volatility and smooth out noise during low volatility.

This implementation enhances the original concept by integrating Discontinued Signal Lines (DSL). Unlike a standard signal line which is a simple moving average of the indicator, DSL creates dynamic levels. When the indicator crosses a level in a specific direction, a new Exponential Moving Average (EMA) is calculated for that signal line. If the indicator moves in the opposite direction, the signal line "freezes" and its previous value is inherited, creating a horizontal level. This hybrid approach combines the benefits of trailing signal lines with fixed support and resistance levels.

Settings

Source Settings

  • Heiken-Ashi Better Smoothing: Selects the smoothing algorithm for Heiken-Ashi based sources (AMA, T3, or Kaufman).
  • Source: Provides a wide array of price source options, including standard price points, Heiken-Ashi variants, and trend-biased sources.

Basic Settings

  • Period: Sets the lookback period used for the deviation scaling and RMS calculations.

Signal/DSL Settings

  • Signal Period: Determines the smoothing length of the DSL signal lines.
  • Signal/DSL Smoothing: Selects between a standard EMA or a Fast EMA for the signal line calculation.
  • Signal Type: Chooses the logic for trend detection (Slope or Level Crosses).

UI Options

  • Color bars?: Enables or disables the coloring of price bars based on the current trend state.
  • Show signals?: Toggles the visibility of on-chart Long and Short labels.

Moving Average Inputs

  • Kaufman's Adaptive MA (KAMA) Only: Adjusts the fast and slow end constants for KAMA-based sources.
  • Adaptive Moving Average (AMA) Only: Adjusts the fast and slow periods for AMA-based sources.

FAQ

How do I interpret the colored lines on the chart? The thick center line is the Deviation Scaled Moving Average. The two outer lines are the Discontinued Signal Lines (DSL). Green indicates a bullish state, red indicates a bearish state, and blue represents a neutral or transitioning state.

What is the difference between the "Slope" and "Levels Crosses" signal types? The "Slope" setting generates signals based on whether the DSMA is moving up or down relative to its previous value. "Levels Crosses" requires the DSMA to actually cross the upper or lower DSL levels, typically resulting in fewer, more filtered signals.

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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.