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
예시용 — 합성 데이터로, 실시간 호가가 아닙니다.
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 Measure each bar's true range
- 2 Smooth it over the chosen period
- 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:
- 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.
- Average true range over the chosen period.
- 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 Expansion
Builder로 구현 가능Stop and Target Sizing
Builder로 구현 가능Regime Classification
고급 로직MT5 구현
MetaTrader 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 전략 구축
신호를 진입 및 청산 규칙에 연결하고, 컴파일 가능한 MT5 EA를 내보내세요 — 코드 없이.
- Fast ATR (14)
- Slow ATR (50)
- Fast ATR above slow ATR
- Price breaks the upper fractal → Open Buy · SL 50 / TP 100
- Price breaks the lower fractal → Open Sell
ATR을 다른 지표와 결합
하나의 지표만으로는 충분하지 않습니다. 이 조합들이 ATR의 취약점을 보완합니다.
ATR + DeMarker
- ATR below its value 20 bars ago
- DeMarker below 0.3
- Buy
ATR + Fractals
- Fast ATR above slow ATR
- Price breaks the last fractal
- Buy
ATR + Moving Average
- Fast MA crosses slow
- ATR sets the stop distance
- Buy
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.
Builder 열기 →ATR + Bollinger Bands
- Bands narrow
- ATR at a local low
- Wait for expansion
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.
Builder 열기 →ATR + Supertrend
- ATR expanding
- Supertrend flips up
- Buy
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.
Builder 열기 →매개변수
자신의 통화쌍과 시간 프레임에서 검증할 초기값 — 보장된 설정이 아닙니다.
| 매개변수 | 기본값 | 권장 테스트 범위 | 기능 |
|---|---|---|---|
| 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. |
초기 프리셋
시장 예시
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.