Displaced MA
By LuxAlgoJan 17, 2026
Displaced MA plots an ordinary moving average shifted along the time axis (a 7-period SMA displaced 5 bars forward by default, DiNapoli's 7x5), with slope coloring, price-cross alerts, and the DiNapoli set as overlays. The math behind a displaced moving average never changes; only the drawing moves, so forward displacement reads today's price against an average finished bars ago, while negative values re-center it over the window it summarizes.
How to Trade the Displaced MA?
- Pullback to the displaced line: a forward-displaced average holds still while price retraces to it in a trend, the DiNapoli-style pullback reference.
- Bullish / Bearish Price Cross: closes through the value under the current bar flip the slow regime read; both carry alerts.
- Slope coloring: the line tints bullish while the underlying average rises and bearish while it falls. The shift moves the drawing, never the math.
- DiNapoli overlays: enable the 3x3, 7x5, and 25x5 close-based SMAs for the layered thrust, pullback, and context read.
The stretch past the last bar is an intentionally stale yardstick, not a forecast; a back-displaced line has no value under the newest bars. The dashboard says so instead of faking one.
Displaced MA Settings
- Type (default SMA): the average formula. Any of the five can be displaced.
- Source (default close): series the average is computed on.
- Length (default 7): the rolling look-back window.
- Displacement (default 5): bars the plot is shifted: positive rightward, negative leftward.
- Undisplaced Average (default disabled): overlays the unshifted average for comparison.
- 3x3 — SMA 3, Displaced 3, 7x5 — SMA 7, Displaced 5, and 25x5 — SMA 25, Displaced 5 (all disabled): the fixed DiNapoli set.
- Show Dashboard (default enabled): displacement, slope, and price versus the live value.
- Slope Trend Coloring (default enabled) and Line Width (default 2) shape the line.
Frequently Asked Questions
Free on Vela
Run it on Vela. Go further with a paid plan.
- Up to 500 strategy alerts, with webhook automation
- Up to 10× the chart history of Free
- Orderflow lookback up to full history
- Up to 100,000 monthly credits for Quant to customize it
- Futures data alongside crypto, stocks, forex and commodities
Related indicators
Run it on Vela. Make it yours with Quant.
Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.





