Indicator library · Trend

Displaced Moving Average

An ordinary average, drawn a few bars to the left or right of where it was computed. The whole subject is one sentence long, and a forward-displaced line looks like a forecast, which is the reason the page exists.

The calculation

Compute any moving average in the ordinary way, then plot each value n bars to the right or left of the bar it was computed on. That is all of it: no term is added, nothing is weighted differently, and the shape of the line is untouched.

Because nothing about the arithmetic changes, the only thing displacement can change is when the line and the price meet. That is not nothing (a crossover system is entirely a story about when they meet), but it is a much smaller claim than the one a forward-shifted line appears to be making.

An average displaced forward, meeting price laterThe upper panel shows a price series rising for about sixteen bars and then declining before a partial recovery. The lower panel shows an eight-period moving average displaced four bars forward, which traces the same shape as an ordinary average but sits to the right of it, so the price series crosses it several bars later than it crosses the undisplaced line.CLOSESMA 8 +457.99crossed laterAn average displaced forward, meeting price laterThe upper panel shows a price series rising for about sixteen bars and then declining before a partial recovery. The lower panel shows an eight-period moving average displaced four bars forward, which traces the same shape as an ordinary average but sits to the right of it, so the price series crosses it several bars later than it crosses the undisplaced line.CLOSESMA 8 +457.99crossed later
Fig. 1: schematicComputed at build time: an ordinary eight-period average, plotted four bars to the right of where each value was calculated. The shape is identical to the undisplaced line (it has to be, since the numbers are the same numbers), and on this series price falls below the plain average around bar 18 and below the displaced one around bar 21. Four bars of delay, bought with no new information whatsoever.

What the shift cannot do

A line drawn to the right of the last bar reads, visually, as a projection. It is not one. Every value on the displaced portion was computed from closes that had already printed before the shift moved them; drawing yesterday’s average in tomorrow’s position does not make it a statement about tomorrow.

The test is simple and worth applying to any indicator that appears to extend past the last bar: ask which prices produced the value sitting in the future. If they are all past prices, the line is a re-drawing. If a value could not be computed without a price that has not happened, the indicator is repainting, which is a different and worse problem, and one displacement does not have.

Displacement against the alternatives

Three ways to get fewer false crossings
MethodWhat it does to the lineCost
Displace it forwardNothing, the same shape, moved.A fixed, known delay on every signal, in both directions.
Lengthen the periodFlattens it; the turns themselves move.A variable delay that depends on the shape of the move.
Adapt the smoothingChanges responsiveness with the market, as KAMA does.Slowest exactly at reversals, and three parameters to defend.

The first row's honesty is its own recommendation: displacement is the only one of the three whose effect can be stated exactly in advance. Four bars is four bars, in every market condition. What it cannot do is distinguish a shakeout from a reversal, and neither can the other two.

The delay applies in both directions

One consequence of a fixed shift is rarely thought through by the people using it. Displacing an average forward delays the crossing that takes you out of a position exactly as much as the one that takes you in; the line does not know which side of a trade you are on.

That symmetry is usually the opposite of what someone reaching for displacement wants. The complaint being addressed is normally "too many false entries in a choppy market", and the fix delivers "later exits when the market genuinely turns" as part of the same package. If the delay is only wanted on one side, that is a rule about entries rather than a property of the line, and it belongs in the system rather than in the average.

Where it misleads

Known failure modes
SituationWhat goes wrong
Read as a projectionThe values drawn beyond the last bar were computed from prices that have already printed. Nothing is being forecast.
Presented as revealing supportThe same numbers in a different place. Price meeting them there is a consequence of the shift.
Two parameters searchedPeriod and shift can both be tuned on past data, so a displaced average overfits more easily than a plain one.
Backward displacement used for signalsA centred average cannot be computed for recent bars until the future ones arrive. It is an analytical tool only.
Delay in both directionsForward displacement delays exits exactly as much as entries, which is rarely what anyone intends.
Underlying average unstatedSimple, exponential or weighted all displace identically; a disagreement between two charts is never about the shift.

Where it appears without being named

Displacement turns up inside other constructions more often than it is plotted on its own. The Ichimoku cloud is built from averages displaced both forward and back; envelope and channel systems frequently shift their bands; and several published trading systems specify a shift as part of the recipe without drawing attention to it.

Recognising it matters for one reason. When a component of an indicator is drawn ahead of the last bar, the question is always the same. Were the values computed from prices that have already printed? For a displaced average the answer is yes, which makes it honest arithmetic drawn in an unusual place rather than a claim about what happens next.

Why so short a subject earns a page

Because the arithmetic being trivial is exactly what makes the claim around it worth checking. A displaced average is offered in a good deal of trading material as though the shift were a discovery, and the shift is the one part of the whole construction that cannot possibly contain information.

That distinction (between what a calculation does and what its picture suggests) is the thing this library is for. Everything else in it can at least be argued about; this one is settled by reading the formula, which makes it a useful place to practise the habit.

Frequently asked questions

What is a displaced moving average?

An ordinary moving average whose plotted position is moved forward or back along the time axis by a fixed number of bars. Nothing about the calculation changes, the value for any given bar is the same average of the same closes. Only where it is drawn changes, which is why the whole subject fits in a sentence and why the interesting part is what people then do with it.

Does displacing it forward predict anything?

No, and this is the misunderstanding worth naming. A line displaced forward five bars appears to extend into the future, but every value on it was computed from closes that have already happened. It is yesterday’s arithmetic drawn to the right of today. Nothing in the shift adds information. What it does is delay when price and line interact, which changes a system’s behaviour without changing what the line knows.

Why displace an average at all?

Almost always to reduce whipsaw. Shifting the line forward means price has to travel further before crossing it, so a system built on crossings produces fewer signals, a crude but effective filter on a noisy market. The honest description is that displacement trades timeliness for fewer false starts, exactly like lengthening the period, and does it in a way that does not change the shape of the line.

How is that different from just using a longer period?

A longer period changes the line. It smooths more, so the shape flattens and the turns move. Displacement leaves the shape identical and slides it. In practice the effects on a crossover system are similar, and displacement has one property a longer period does not: the amount of delay is exactly known and constant, whereas the lag of a longer average varies with the shape of the move.

What is backward displacement for?

Analysis rather than trading. Shifting an average back aligns it with the middle of its own window rather than its end, which is where a centred average genuinely belongs, a 20-period average describes the middle of those 20 bars, not the last one. It is useful for looking at historical structure and useless for signals, because the recent values of a centred average cannot be computed until the future bars arrive.

Does displacement affect where support and resistance appear?

It moves the line, so anything read off the line moves with it. That is worth stating because a displaced average is sometimes presented as revealing support the undisplaced one missed. It has not revealed anything: it has drawn the same numbers in a different place, and price meeting them there is a consequence of the shift rather than a discovery about the market.

Which conventions exist?

Any period with any shift, and the common pairings — a 21-period average displaced 5 forward, or the 5-13-62 combinations that circulate in some trading systems — are conventions rather than findings. Because the shift is a second free parameter, a displaced average is easier to overfit than a plain one: two numbers can be searched instead of one, and the resulting improvement on past data is correspondingly less likely to survive.

Does it change what the average is computed from?

Never. Simple, exponential and weighted averages can all be displaced, and the displacement is applied after the calculation. If two charts of a displaced average disagree, the cause is the underlying average (the smoothing type, the period, or how much history it was fed), and not the shift, which is arithmetic that cannot go wrong.