ZLMA - Low-Lag Moving Average Based On An Alternative SMA Design
Mar 24, 2020

The ZLMA indicator provides a highly customizable low-lag moving average based on an alternative Simple Moving Average (SMA) design, allowing traders to reduce delay while maintaining smoothing capabilities. This tool is specifically designed to offer adjustable responsiveness, enabling users to balance the trade-off between noise filtering and signal lag for better trend identification.
Usage
The Usage section describes how the script can be used, particularly in identifying trends and potential reversal points.
- Trend Identification: The ZLMA changes color based on its slope. A green line indicates an upward trend, a red line indicates a downward trend, and a blue line represents a neutral or flat state.
- Lag Customization: Users can adjust the "Lag" setting to make the moving average react faster to price changes. A higher lag value reduces delay but increases the potential for overshoots, while a value of 1.0 makes the indicator behave like a standard Simple Moving Average.
- Crossovers: Traders often use price crossovers with the ZLMA as potential entry or exit signals. The script includes built-in alerts for when the price crosses above or below the moving average line.
Details
The ZLMA is constructed using a cumulative sum/change design rather than a standard rolling window sum. This implementation allows for a more efficient calculation and the ability to manipulate the lag component directly.
The core logic utilizes the following mechanism:
- A cumulative value is calculated by blending the current price with previous data points adjusted by the lag factor.
- The final output is derived from the change in this cumulative sum over the specified length, divided by that length.
By increasing the lag factor (typically between 1.0 and 2.0), the moving average is pulled closer to the current price, significantly reducing the "phase lag" common in traditional SMA or EMA indicators. However, like most low-lag filters, high sensitivity can lead to frequency amplification, where the indicator might overshoot price during volatile movements.
Settings
- Length: Determines the period of the moving average. Larger values provide more filtering and a smoother line, while smaller values make it more reactive.
- Lag: Controls the responsiveness of the indicator. A value of 1.0 represents a standard SMA. Values closer to 2.0 reduce lag significantly but may cause the indicator to overshoot the price.
- Source: Defines the price data used for the calculation (e.g., Close, Open, High, Low).
FAQ
How do I adjust the responsiveness of the ZLMA? You can adjust the responsiveness by changing the "Lag" input. Increasing this value closer to 2.0 will make the indicator react faster to price movements, while decreasing it toward 1.0 will provide a smoother, more traditional moving average.
What do the different colors on the line represent? The color coding represents the direction of the trend: green signifies a rising ZLMA (bullish momentum), red signifies a falling ZLMA (bearish momentum), and blue signifies no change in value.
How can I access the ZLMA 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.