Adaptive Moving Average
AMA
The Adaptive Moving Average changes its own smoothing on every bar: it tracks price closely when a move is directional and flattens out when the market is just oscillating. It is the trend filter you reach for when a fixed-period average is either too slow in trends or too twitchy in ranges.
- Template periods
- 9 / 2 / 30
- Adaptation
- Efficiency ratio
- Scale
- Price
توضيحي — بيانات اصطناعية، ليست تسعيرة مباشرة.
What the AMA tells you
The AMA answers the same question as any average — which way price has been going — but it decides for itself how much to smooth. It measures how much of the recent movement was net travel rather than back-and-forth, and speeds up or slows down accordingly. In a clean trend it behaves like a short average; in chop it goes almost flat and stops generating direction.
- Price above a rising AMA: the trend is up and the line is tracking it
- Price below a falling AMA: the trend is down
- A flat AMA is information, not a failure — it says the market went nowhere
- 1 Measure net travel against total travel
- 2 Turn that ratio into a smoothing constant
- 3 Step the line toward price by that amount
عرض الصيغة وتفاصيل الحساب
The Adaptive Moving Average is a recursive average whose smoothing constant is recomputed on every bar from how efficiently price has been moving:
- Measure the efficiency ratio over the period N:
ER = |P − P₍ₙ₎| / Σ|Pᵢ − Pᵢ₋₁|. The numerator is net travel from N bars ago to now; the denominator is the total distance covered bar by bar. A straight-line move gives ER near 1; a market that ends where it started gives ER near 0. - Convert the two period bounds into smoothing constants —
fastSC = 2 / (fast + 1)andslowSC = 2 / (slow + 1)— and interpolate with the ratio, then square the result:SC = [ER × (fastSC − slowSC) + slowSC]². Squaring is what makes the quiet end genuinely flat rather than merely slow. - Step the line toward price by that amount:
AMA = AMAprev + SC × (P − AMAprev).
With the MT5 defaults of 9 / 2 / 30, the smoothing constant lives between roughly 0.004 and 0.44 — so the same indicator can behave like a very short average or a very long one depending on nothing but the shape of recent price action. That is the whole idea: the parameter you would otherwise have to guess and re-optimise per regime is being set by the market instead.
In MQL5 the call is iAMA(symbol, period, ama_period, fast_ma_period, slow_ma_period, ama_shift, applied_price) and it returns a handle to one buffer. Both the applied price and all three period arguments are real inputs; the efficiency ratio itself is internal and is not published as a buffer, so a rule that wants to read “how efficient is this market” has to reconstruct it rather than copy it.
الإشارات
الإشارات المتميزة والقابلة للاختبار التي يوفرها AMA — والنظام الملائم لكل منها.
Fast / Slow AMA Cross
جاهز في المنشئPullback to the AMA
جاهز في المنشئWaking Up From Flat
منطق متقدمتنفيذ MT5
ما يحسبه ويرسمه ميتاتريدر 5 فعليًا — وهو المرجع الذي كُتبت وفقه كل قاعدة في هذه الصفحة.
المخازن
| الفهرس | المخزن | طريقة الرسم في MT5 | ما يحتويه |
|---|---|---|---|
| 0 | MAIN_LINE | Line | The adaptive average itself, plotted on the price scale. iAMA publishes one buffer — the efficiency ratio that drives the adaptation is internal and is not exposed as a second buffer you can read. |
ملاحظات المنصة
يعمل بشكل أفضل / استخدم بحذر
لا يوجد مؤشر ذو ميزة شاملة. إليك أين يساعد AMA — وأين يضلل.
يعمل بشكل أفضل
- Markets that alternate between trending and ranging
- As a directional filter for a faster signal
- When a fixed-period average whipsaws in chop
- Higher timeframes where the regime is stable enough to read
استخدم بحذر
- Very tight ranges, where the line barely moves at all
- As a standalone entry trigger
- Optimising all three periods at once
- Assuming adaptation removes lag — it only varies it
بناء استراتيجية AMA
اربط الإشارة بقواعد الدخول والخروج، ثم صدّر EA MT5 قابلاً للترجمة — بدون كود.
- AMA (9 / 2 / 30) on Close
- Bid price compared against the AMA
- AO crosses above zero and price is above the AMA → Open Buy · SL 50 / TP 100
- AO crosses below zero and price is below the AMA → Open Sell
دمج AMA مع مؤشرات أخرى
نادراً ما يقف مؤشر واحد وحده. هذه التوليفات تغطي النقاط العمياء لـ AMA.
AMA + Awesome Oscillator
- Price above the AMA
- AO crosses above zero
- Buy
AMA + ATR
- Price above the AMA
- ATR sets stop distance
- Buy
No single-flow template pairs the AMA with ATR. Start from AO + AMA and add an ATR node feeding a risk-based lot or stop node — the Fractal Breakout + ATR template shows that wiring.
افتح المنشئ →AMA + Moving Average
- AMA above SMA 9
- Price above both
- Buy
No single-flow template pairs the AMA with a fixed-period moving average. Start from AO + AMA and add an MA node with a Compare against the AMA into the existing And gate.
افتح المنشئ →AMA + FrAMA
- Price above the AMA
- FrAMA crosses above a fixed average
- Buy
No single-flow template pairs the two adaptive averages. Start from FrAMA vs Fixed EMA and add an AMA node with a Price node into a Compare, joined to the existing Cross with an And gate.
افتح المنشئ →المعاملات
قيم أولية للتحقق على زوجك الخاص وإطارك الزمني — ليست إعدادات مضمونة.
| المعامل | الافتراضي | نطاق الاختبار المقترح | ما يفعله |
|---|---|---|---|
| Period | 9 | 5–30 | The window the efficiency ratio is measured over — how far back the indicator looks to decide whether the market is trending. Short windows switch the line between fast and slow more often; long windows commit to a regime. |
| Fast EMA period | 2 | 2–10 | The fast end of the smoothing range. It sets how responsive the line is allowed to become when travel is efficient. It is a bound on adaptation, not a second average of price. |
| Slow EMA period | 30 | 20–100 | The slow end of the smoothing range — how flat the line goes when the market is churning. Raising it makes quiet periods flatter and the contrast with trends sharper. |
| Applied price | Close | Close / Open / High / Low / Median / Typical / Weighted | Price series the average runs on. iAMA takes this as a real ENUM_APPLIED_PRICE argument, so Median and Typical are available if you want the bar's range folded in. |
| Shift | 0 | 0–3 | Which bar back the node reads the buffer from. Shift 1 evaluates against a fully closed bar. This is the node's read offset, not the indicator's own horizontal displacement. |
الإعدادات المسبقة الأولية
أمثلة السوق
أين يعمل AMA، وأين يفشل، وكيف يغير الفلتر النتيجة.
Flat line, then a clean lean
The AMA sits horizontal through a range and starts sloping as price breaks out. Because the line was flat, the crossing is unambiguous and it stays on one side for the whole leg.
Crossing a flat line repeatedly
In a tight range the line barely moves and price oscillates across it. Adaptation reduces the number of these crossings compared with a fixed average, but it does not remove them.
Momentum has to agree
With a momentum condition added, the same cluster of crossings is ignored until something actually flips — which is exactly what the AO + AMA template wires up.
FAQ
- How is the AMA different from an EMA?
- An EMA uses one fixed smoothing constant, so its lag is the same whatever the market is doing. The AMA recomputes its smoothing constant on every bar from an efficiency ratio — net movement divided by total movement over the period. When price travels in one direction the constant moves toward the fast bound and the line tracks closely; when price churns it moves toward the slow bound and the line flattens. Same output shape, variable responsiveness.
- Is the AMA the same as Kaufman's KAMA?
- Yes. MT5 ships Perry Kaufman's Adaptive Moving Average under the name AMA, and iAMA implements the standard KAMA construction with the efficiency ratio and the squared smoothing constant. The defaults of 9 / 2 / 30 are MT5's, and they match the values the Builder's AO + AMA template loads.
- What do the fast and slow periods actually change?
- They set the two ends of the range the adaptation moves between. Lowering the fast period lets the line become more aggressive in clean trends; raising the slow period makes it flatter in chop and therefore a stricter filter. Neither is a moving average of price in its own right, which is the most common misreading of the parameter names.
- Does adaptation remove the lag?
- No, it varies it. The AMA still only reports what price has already done — the difference is that it accepts more lag when lag is cheap (in a range, where you did not want signals anyway) and less when it is expensive (in a trend). Treating an adaptive average as a leading indicator inverts what it is for.
- Can I build an AMA EA without coding?
- Yes for the directional read. The AO + AMA template puts an AMA node against the Bid price with a Compare node and gates a momentum cross on it, exposing period, fast, slow and applied price as EA inputs. Reading the efficiency ratio directly, or detecting the moment the line wakes up from flat, are the exceptions and need custom MQL5.
- How should I validate settings before going live?
- Backtest on quality tick data first, then run the EA on a demo account before risking money. Three periods means a large search space, so optimise one at a time, hold back data the search never saw, and prefer settings that stay profitable across periods over the single in-sample peak — chasing that peak is overfitting the noise. No default or preset here is a performance promise; every value is a starting point to re-validate on your own pair and broker.
مقالات ذات صلة
Glossary