Swing Structure ATR
- 지표
- 버전: 2.20
Swing Structure ATR
Swing Structure ATR is a chart indicator for MetaTrader 5. It tracks price swings at three scales that are measured in ATR: a fast level (1x ATR), a medium level (2x ATR) and a slow level (4x ATR). ATR here is a simple moving average of true range.
The indicator is intended as a structure map, not as an automatic trading system. It does not place, modify or close orders.
How a signal is confirmed
The logic uses closed bars only.
1. While a swing is forming, the indicator updates the current extreme with each closed bar.
2. A swing in the opposite direction is confirmed only when the close of a completed bar has moved at least N times the current ATR away from that extreme (N = 1, 2 or 4 by default).
3. The arrow is placed on the confirmation bar, at the low of an upward confirmation or at the high of a downward confirmation.
4. After that the arrow is not moved to an earlier bar. The forming bar is left empty, so an Expert Advisor should read shift 1 (the last closed bar) or an older closed shift.
This is the same closed-bar rule that was checked on historical XAUUSD H1 data before this Market build. Past use of the indicator, in tests or on a live chart, does not guarantee future results.
What you see on the chart
- L1 arrows (blue): faster swings, 1x ATR by default.
- L2 arrows (green / coral): intermediate swings, 2x ATR by default.
- L3 arrows (lime / tomato): slower swings, 4x ATR by default.
- A dotted line: the last confirmed L3 support (the confirmed swing low of the slow state).
- A compact status label with the current L3 direction and the ATR value.
Each level and the support line can be hidden in the inputs. Colors and arrow size are also configurable. Optional alerts can be enabled for new L2 or L3 confirmations. Alerts are raised only when a new closed bar produces a confirmation.
Buffers for Expert Advisors
The indicator exposes ten buffers. Index 0 is the still-forming bar and is always empty. Use CopyBuffer or iCustom with shift 1 or greater.
- 0 / 1: L1 up / down arrow price, or empty
- 2 / 3: L2 up / down arrow price, or empty
- 4 / 5: L3 up / down arrow price, or empty
- 6 / 7 / 8: L1 / L2 / L3 direction (+1 up, -1 down, 0 not ready)
- 9: last confirmed L3 support, or empty
The calculation works on any symbol and any timeframe. The default period (24) and the 1 / 2 / 4 multipliers are starting values, not a claim that they are optimal for every market.
Inputs
Calculation
- True-range SMA period (default 24). Allowed range: 2 to 500.
- Fast / medium / slow ATR multipliers (defaults 1.0, 2.0, 4.0).
- Start of calculation: server time. Leave at 0 to use all available bars.
Display
- Show or hide L1, L2, L3 arrows and the L3 support line.
- Show or hide the status label.
- Arrow width and vertical offset.
- Colors for each arrow series and for the support line.
Alerts (closed bar only)
- Alert on a new L2 confirmation (default: off).
- Alert on a new L3 confirmation (default: off).
- Optional sound file from the terminal Sounds folder.
Requirements and limits
- Platform: MetaTrader 5.
- No DLL calls, no WebRequest, no external files and no internet connection.
- The indicator does not trade and does not access trading history of the account.
- A swing map is not a buy or sell signal by itself. Confirmations can arrive late, and a new swing can fail. Use your own rules for risk and for trade decisions.
About the author
This indicator is published by the author of Golden Sniper XAU, a paid Expert Advisor for gold on MetaTrader 5:
https://www.mql5.com/en/market/product/207995
Swing Structure ATR is a free, standalone structure tool. It is not an entry module of that Expert Advisor, and attaching the indicator does not reproduce the Expert Advisor's results.
Risk warning
Trading in financial markets involves a high level of risk and can lead to the loss of the entire deposit. The screenshots show historical chart examples of the indicator, not trading results. Past performance, simulated or real, does not guarantee future results.
