Why an adaptive moving average slows on a winding price path

Why an adaptive moving average slows on a winding price path

Keep the endpoints fixed

Start both paths at 100 and finish at 104 four bars later. The direct path runs through 101, 102 and 103. The winding path runs through 104, 100 and 106. A simple endpoint comparison sees a gain of 4 in both cases. In the AMA calculation, the denominator also records the absolute distance covered on every step, including steps that later reverse.

Measure travel before smoothing

The direct path travels 4 units, yielding an efficiency ratio of 1. The winding path travels 16, yielding 0.25. Use four changes, hence five prices; counting only four prices drops the first step. A steady downward path can also reach an efficiency of 1 because the numerator is absolute. The direction of the eventual update comes from the signed gap between price and the previous average.

ER = |P₄ − P₀| / Σ|ΔP|
α = [2/31 + ER × (2/3 − 2/31)]²

Reproduce one update with a known seed

Use fast length 2 and slow length 30. Convert each length to an EMA coefficient, interpolate between the slow and fast coefficients using efficiency, then square the result. With a previous AMA of 100 and a final price of 104, the direct path gives about 101.78 and the winding path about 100.18. Giving the two cases the same starting average isolates the response coefficient; these are single-step examples.

Find two common mismatches

If your direct-path result is close to 102.67, the squaring step was probably omitted. If your efficiency exceeds 1, check whether you added signed changes instead of absolute changes. When all prices are equal the path length is zero. Mark that case before division and document the fallback used by the implementation under comparison.

Test against a closed chart bar

Match the applied price and all three periods in the MT5 settings. For a check of one update, take the previous closed AMA directly from the Data Window and supply that value as your seed. For a check of an entire series, give both runs the same prehistory. This separates a local formula error from a difference introduced many updates before the visible chart.

Practice files

These CSV files contain synthetic teaching data, not market observations or investment results.

Download the CSV

Sources and further reading

Back to top

MQLume Bespoke

Built around your ambition.

Explore bespoke services →

Have something more specific in mind?

Ask us about advanced custom development. Share your requirements through private support or email; we will discuss the scope and quote separately.

100% committed to following up on your delivery and support requests.

Free downloads. Real source files.

FREE

Lizard [MQLume]

MQL5 / MT5Version v2.21

Free editable gold breakout project with six independently selectable cores, session filters and flexible position sizing.

US$149.00FREE
FREE

Scraper Gold [MQLume]

MQL5 / MT5Version v3.80

Free editable source with compiled EX5: four gold breakout engines with independent profiles, sizing, direction and exits.

US$95.00FREE
FREE

EA Black Dragon [MQLume]

MQL5 / MT5Version v13.0

Trend-based entries with optional grid additions, side controls and virtual exits.

US$30.00FREE
FREE

Hamster Scalping [MQLume]

MQL5 / MT5Version v21.0

RSI entries with two ATR filters, configurable sessions and optional grid management.

US$30.00FREE
MQLume

More to explore. A community to share it with.

Stay close to MQLume, wherever you like to learn.

YouTube

See our EAs in action. Explore backtests, walkthroughs and practical guides.

Watch on YouTube

Telegram

Meet other EA users, share ideas and keep up with what’s new.

Join the community Follow official updates

Cart

One personal-use licence per project. Each project can be added once.

Your cart is waiting for its first passenger.

Choose an EA or source edition to get started.

Continue shopping