التقلب VolatilityRisk SizingFilter متاح في المنشئ

Average True Range (ATR)

ATR

ATR measures how far an instrument typically travels in one bar, including the gaps between bars. It says nothing about direction — which is exactly why it is the standard way to size stops, set breakout distances, and tell a calm market from a violent one.

Default period
14
Direction
None
Units
Price
OverboughtOversoldCentreline 50Divergence

توضيحي — بيانات اصطناعية، ليست تسعيرة مباشرة.

What ATR tells you

ATR answers one question: how much room does this instrument need right now? It averages the true range of recent bars — the full distance travelled, gaps included — and returns it in price units. A rule built on ATR adapts to the market instead of assuming a fixed pip distance is always right.

  • Rising ATR: bars are getting larger — volatility is expanding
  • Falling ATR: the market is compressing, not necessarily reversing
  • ATR has no direction — it never says up or down
  1. 1 Measure each bar's true range
  2. 2 Smooth it over the chosen period
  3. 3 Read the result in price units
عرض الصيغة وتفاصيل الحساب

ATR is built from true range, which is deliberately larger than the visible bar when the market gaps:

  1. For each bar, take the largest of three distances: high minus low, the absolute distance from the previous close up to this high, and the absolute distance from the previous close down to this low. That is the bar’s true range.
  2. Average true range over the chosen period.
  3. Read the result in the instrument’s own price units — 0.0012 on a 5-digit FX pair, 4.10 on an index.

Including the previous close is the whole point of the “true” in true range: a market that gaps 40 pips overnight and then trades in a narrow band has moved 40 pips, even though the bar itself looks small. A plain high-minus-low average would miss that entirely.

Step 2 hides a platform detail that is worth stating plainly, because Wilder’s own ATR and MetaTrader’s are not the same average. Wilder smooths: each bar updates a running value that never forgets anything, only decays it. ATR.mq5, bundled with the terminal under Indicators/Examples, rolls a window instead:

Wilder     ATR[i] = (ATR[i-1] * (N-1) + TR[i]) / N
MetaTrader ATR[i] =  ATR[i-1] + (TR[i] - TR[i-N]) / N     <- a simple moving average

The recurrence in the second line looks like a smoothing, but subtracting the true range from N bars ago is what a rolling window does. Both are linear filters whose weights sum to one, so their long-run averages agree — measured over 2,700 bars at period 20, 9.571 against 9.573 pips. The difference is timing: on a series whose volatility tripled at a fixed bar, MetaTrader’s version reached 90% of the new level in 19 bars and Wilder’s took 59. Matching the period does not merge them either; the closest iATR period to Wilder’s ATR at 20 was measured at 32–33, not the 39 that matching the centre of mass predicts. Where this matters most is any indicator that uses ATR as a width — the Keltner Channel page follows that consequence through.

In MQL5 the call is iATR(symbol, period, ma_period) and it returns a handle to a single buffer. There is no applied-price argument — true range is already defined from the high, the low and the previous close. It is also written in an unfamiliar but equivalent form in the source: max(high, close_prev) - min(low, close_prev), which is the same quantity as the maximum of the three distances above — measured across 44,985 gapped bars the two forms differ by exactly zero. J. Welles Wilder introduced ATR in 1978, alongside RSI.

الإشارات

الإشارات المتميزة والقابلة للاختبار التي يوفرها ATR — والنظام الملائم لكل منها.

Volatility Contraction

جاهز في المنشئ
الشرط
ATR falls to a local low relative to a longer ATR
أفضل نظام
Pre-breakout
الاستخدام النموذجي
Wait for expansion rather than trading the quiet

Volatility Expansion

جاهز في المنشئ
الشرط
A short ATR rises above a long ATR
أفضل نظام
Breakouts
الاستخدام النموذجي
Confirm a break is happening on real range, not a single wick

Stop and Target Sizing

جاهز في المنشئ
الشرط
Stop distance set as a multiple of current ATR
أفضل نظام
Any
الاستخدام النموذجي
Keep risk per trade constant as volatility changes

Regime Classification

منطق متقدم
الشرط
ATR relative to its own long-run distribution
أفضل نظام
Any
الاستخدام النموذجي
Switch strategy behaviour between calm and violent regimes

تنفيذ MT5

ما يحسبه ويرسمه ميتاتريدر 5 فعليًا — وهو المرجع الذي كُتبت وفقه كل قاعدة في هذه الصفحة.

المخازن

الفهرس المخزن طريقة الرسم في MT5 ما يحتويه
0 MAIN_LINE Line The smoothed average of true range, in the instrument's price units. Always positive; it has no zero line and no upper bound.

ملاحظات المنصة

يعمل بشكل أفضل / استخدم بحذر

لا يوجد مؤشر ذو ميزة شاملة. إليك أين يساعد ATR — وأين يضلل.

يعمل بشكل أفضل

  • Sizing stops and targets
  • Confirming breakouts
  • Comparing regimes on one instrument
  • As a filter on top of a directional signal

استخدم بحذر

  • As a directional signal
  • Comparing raw ATR across instruments
  • Fixed pip thresholds on ATR
  • Very short periods on low timeframes

بناء استراتيجية ATR

اربط الإشارة بقواعد الدخول والخروج، ثم صدّر EA MT5 قابلاً للترجمة — بدون كود.

  1. Fast ATR (14)
  2. Slow ATR (50)
  3. Fast ATR above slow ATR
  4. Price breaks the upper fractal → Open Buy · SL 50 / TP 100
  5. Price breaks the lower fractal → Open Sell

دمج ATR مع مؤشرات أخرى

نادراً ما يقف مؤشر واحد وحده. هذه التوليفات تغطي النقاط العمياء لـ ATR.

ATR + DeMarker

  1. ATR below its value 20 bars ago
  2. DeMarker below 0.3
  3. Buy
السبب
Use ATR the other way round — not to confirm expansion but to require contraction, so an exhaustion reading is only faded once the market has stopped making genuinely new ground
أفضل نظام
Ranging
بناء هذه الاستراتيجية →

ATR + Fractals

  1. Fast ATR above slow ATR
  2. Price breaks the last fractal
  3. Buy
السبب
Only take a swing-level breakout when volatility is genuinely expanding, so a break on a dead bar never triggers the trade
أفضل نظام
Breakout
بناء هذه الاستراتيجية →

ATR + Moving Average

  1. Fast MA crosses slow
  2. ATR sets the stop distance
  3. Buy
السبب
Take the direction from the trend and the distance from volatility, so the same rule behaves the same way in calm and violent markets
أفضل نظام
Trend

No single-flow template pairs ATR with a moving average. Start from MA Crossover and add an ATR node feeding a risk-based lot or a stop node.

افتح المنشئ →

ATR + Bollinger Bands

  1. Bands narrow
  2. ATR at a local low
  3. Wait for expansion
السبب
Cross-check a band squeeze against a falling ATR, since both describe compression but measure it differently
أفضل نظام
Pre-breakout

No single-flow template pairs ATR with Bollinger Bands. Start from Bollinger Bounce and add ATR nodes with a Compare between a fast and a slow period.

افتح المنشئ →

ATR + Supertrend

  1. ATR expanding
  2. Supertrend flips up
  3. Buy
السبب
Supertrend is ATR turned into a direction: its band sits a fixed multiple of this reading from each bar's midpoint, so the width you see here is literally the room the trend is being given. Reading them together shows why a flip happened — through a band that had widened, or through one that volatility had collapsed onto price
أفضل نظام
Trending

The Supertrend Flip template already trails its stop at 3 × ATR(10), the same width its band uses. To require the width to be expanding as well, add two ATR nodes at different shifts with a Compare between them.

افتح المنشئ →

المعاملات

قيم أولية للتحقق على زوجك الخاص وإطارك الزمني — ليست إعدادات مضمونة.

المعامل الافتراضي نطاق الاختبار المقترح ما يفعله
Period 14 5–50 How many bars of true range are smoothed. Wilder's 14 is the standard; shorter reacts to a single violent bar, longer describes the session rather than the moment.
Shift 0 0–3 Which bar back the value is read from. Reading shift 1 compares against a fully closed bar, which some rules prefer over the forming one.
Multiple (your rule) 1.5–2.0 1.0–4.0 Not an indicator input — the factor your strategy multiplies ATR by to get a stop or breakout distance. Listed here because it is the number that actually needs testing.

الإعدادات المسبقة الأولية

Reactive 7 Follows single-bar shocks
Standard 14 Wilder's default baseline
Regime 50 Describes the session, not the bar

أمثلة السوق

أين يعمل ATR، وأين يفشل، وكيف يغير الفلتر النتيجة.

يعمل

Expansion confirms the break

A range resolves and ATR rises with it; the breakout has real range behind it rather than a single stretched wick.

يفشل

Fixed stop in a violent session

The same fixed pip stop that survived a quiet week is taken out by ordinary noise once bars double in size — the loss ATR sizing exists to avoid.

مُصفّى

Contraction suppresses the trade

The directional signal fires but ATR is at a local low, so the entry is skipped and the market goes on to drift sideways.

FAQ

What ATR period should I use?
14 is Wilder's default and the right starting point. Shorter periods react to a single violent bar and make stop distances jump around; longer periods describe the session rather than the current moment. Treat 14 as a documented baseline to re-validate on your pair and timeframe, not as portable truth.
Does ATR tell me which way price will go?
No, and it cannot. True range is a distance, so ATR is always positive and carries no sign. It tells you how much room a move needs; something else has to tell you the direction. Any strategy that appears to trade ATR directionally is really trading whatever is feeding it the direction.
Why does ATR have no applied-price setting?
Because true range is already defined from three prices: the current high, the current low, and the previous close. There is no single series to pick, so MQL5's iATR takes only a period. An applied-price input on an ATR is a sign the indicator is not the standard one.
How many ATRs should my stop be?
There is no correct multiple, only a trade-off: a tighter stop is hit by noise more often, a wider one costs more when it is hit. 1.5 to 2 ATR is a common starting band. Test the multiple like any other parameter, and remember that changing it changes position size if your lot is risk-based.
Can I build an ATR EA without coding?
Yes, as a filter and as a sizing input. The Fractal Breakout template uses two ATR nodes with different periods and a Compare to require expanding volatility, and the Builder's risk-based lot node can take a volatility-derived distance. Classifying volatility against its own long-run distribution is the exception and needs 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. When optimising, 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.