거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
지표

ATR Dynamic Support and Resistance Bands - MetaTrader 5용 지표

조회수:
135
평가:
(1)
게시됨:
AtrBands.mq5 (10.33 KB) 조회
AtrBands_fig1.png (43.83 KB)
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

ATR Dynamic Support and Resistance Bands

The idea behind it

Fixed price levels do not adapt to the market: a 50-pip move means a lot on a quiet day and very little on a volatile one. This indicator solves that by measuring the distance from a central moving average in units of ATR, the average true range of recent bars.

The upper band is basis + multiplier x ATR and the lower band is basis - multiplier x ATR. Price tends to react near these bands, so they work as dynamic resistance and support that automatically adjust to current volatility.

The ATR is calculated inside the indicator with Wilder smoothing, so no indicator handles are needed. On each new tick only the last bar is recalculated, and the full history is processed only once at start.

How to interpret it

  • Upper band (dashed line) - dynamic resistance. Price reaching it in a range can signal an overextended move; a close beyond it with expanding bands can signal a breakout.
  • Lower band (dashed line) - dynamic support, interpreted in the same way for downward moves.
  • Basis line (dotted line) - the moving average (SMA or EMA) that the bands are built around. It acts as the "mean" price and as dynamic support or resistance inside a trend.
  • Distance between the bands - a direct view of volatility. Narrowing bands show a quiet market and often precede a volatility expansion; widening bands show increasing volatility.
  • Info label (top-left corner) - the ATR settings and the current ATR value in price units, useful for sizing stop-losses and targets.

Bands are context, not signals on their own. In a strong trend price can walk along a band for a long time, so confirm with price action or other tools.

External variables (inputs)

Input Default Purpose
Basis line
InpBasisPeriod 20 Period of the basis moving average (2 and above)
InpBasisMethod BASIS_SMA Basis moving average method: BASIS_SMA (simple) or BASIS_EMA (exponential)
ATR bands
InpAtrPeriod 14 ATR period (1 and above)
InpMultiplier 2.0 ATR multiplier; the distance of each band from the basis (must be greater than zero)
Appearance
InpUpperColor clrWhite Color of the upper band
InpLowerColor clrSilver Color of the lower band
InpBasisColor clrGray Color of the basis line
InpBandStyle STYLE_DASH Line style of the upper and lower bands
InpBasisStyle STYLE_DOT Line style of the basis line
InpLineWidth 1 Line width of all lines (1 to 5)
InpShowBasis true Show or hide the basis line
Info label
InpShowInfo true Show the info label with the ATR value in the chart corner
InpInfoColor clrWhite Color of the info label

Recommended use

  • Works on any symbol and timeframe. Start with the defaults (SMA 20, ATR 14, multiplier 2.0) on M15 to H4 charts.
  • A smaller multiplier (1.0-1.5) gives tighter bands for scalping and short-term targets; a larger one (2.5-3.0) highlights only extreme moves.
  • The EMA basis reacts faster to price changes, the SMA is smoother. Choose according to your style.
  • The values of closed bars do not change (no repainting). The last bar is recalculated while it is forming, as with any moving average or ATR.
  • The ATR is a lagging measure, so after a sudden news spike the bands adapt only over the next bars.
  • The indicator needs at least a few more bars than the larger of the two periods to start drawing.
  • It is a chart indicator only and does not trade, so it works the same on netting and hedging accounts.

Fig. 1. AtrBands on an H1 chart with default settings (black and white image per Code Base guidelines).

Supertrend EA Gold Breakeven Supertrend EA Gold Breakeven

Supertrend expert advisor for MT5 on Gold (XAUUSD), forex and indices: entry on the closed candle of the flip, stop at the Supertrend line, target by stop multiple, breakeven and lot by risk percent. Open source code.

Daily Pivot Points – Classic, Fibonacci and Camarilla Daily Pivot Points – Classic, Fibonacci and Camarilla

Daily pivot point with three resistance levels and three support levels, using Classic, Fibonacci or Camarilla formulas.

Candle Countdown Timer and Spread Display on Chart Candle Countdown Timer and Spread Display on Chart

Shows the time left until the current candle closes and the current spread in a corner of the chart. The countdown updates every second, even when no new ticks arrive.

Supertrend Indicator with Trend Color Change Supertrend Indicator with Trend Color Change

Supertrend trend-following indicator based on ATR. The line changes color and side of the price when the trend changes, with optional signal arrows and alerts.