Displaced Moving Average Exponential
Aug 7, 2017

The Displaced Moving Average Exponential indicator projects an Exponential Moving Average (EMA) forward in time to help traders identify trend direction and potential support or resistance levels while accounting for market lag. By shifting the calculation into the future, it provides a unique visual perspective on price action as popularized by Joe DiNapoli.
Usage
The Usage section describes how the script can be used to improve trend analysis and trade execution. The primary use case involves observing how price interacts with the projected EMA line.
- Trend Identification: When price remains consistently above the displaced EMA, it suggests a strong bullish trend. Conversely, price remaining below the line suggests a bearish trend.
- Support and Resistance: Traders often use the displaced line as a dynamic level of support or resistance. Because the line is shifted forward, it can provide an early warning of a trend shift when price crosses the projected value.
- Crossover Alerts: The script includes built-in logic to detect when the current price crosses the value of the EMA at its displaced position, signaling potential momentum shifts.
Details
The script calculates a standard Exponential Moving Average based on the user-defined length and source. The "displacement" effect is achieved using the offset parameter in the plotting function, which shifts the entire moving average line to the right by a specific number of bars.
This concept was notably detailed by Joe DiNapoli in "Trading With DiNapoli Levels." The displacement helps to filter out market noise and reduces the number of "whipsaws" or false signals that occur with standard moving averages that track price too closely. By offsetting the EMA, the indicator requires a more significant price move to trigger a crossover, effectively acting as a trend-following filter.
Settings
- Displacement: Determines the number of bars the EMA is shifted forward on the chart. Increasing this value creates more lag but provides a smoother trend filter.
- Length: Sets the lookback period for the EMA calculation. A higher length results in a slower, more stable average.
- Source: Specifies the price data used for the calculation (e.g., Close, Open, High, Low).
FAQ
How do I adjust the lag of the indicator? You can adjust the lag by modifying the Displacement and Length inputs. A higher Displacement value will push the EMA further into the future, while a higher Length will make the average react more slowly to price changes.
Can this indicator be used for scalping or long-term trading? Yes, by adjusting the Length and Displacement settings, it can be adapted for various timeframes. Lower settings are typically used for intraday trading, while higher settings are suited for daily or weekly trend analysis.
How can I access the Displaced Moving Average Exponential? 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.