Read the mark direction carefully on the ma atr indicator. A close below the lower band prints a buy, not a sell. It treats a stretch beyond the envelope as something to fade rather than follow, which reverses what a breakout tool would tell you.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Main price chart |
| Plots | 5: MA, Upper, Lower, BUY, SELL |
| Alerts | popup |
| Inputs | 4 |
What the Ma Atr Indicator draws on the chart
Three lines and a pair of marks on price.
`MA` runs deep sky blue at width 2.
`Upper` runs tomato above it.
`Lower` runs lime green below.
A lime `BUY` mark tags a close under the lower band.
A red `SELL` mark tags one over the upper band.
- MA: line, deep sky blue, width 2
- Upper: line, tomato, width 1
- Lower: line, lime green, width 1
- BUY: arrow, lime, width 2, arrow code 233
- SELL: arrow, red, width 2, arrow code 234

How the Ma Atr Indicator calculates its values
The centre
One average holds it. iMA at `MA_Period` `20` on the close, exponential rather than simple, so recent bars carry more weight.
The envelope
Range sets the width. iATR at `ATR_Period` `14` times `ATR_Mult` `2.0` goes either side, so the bands widen when the market does.
Fading the stretch
Direction here is deliberate. A close under the lower band earns a buy mark, and a close over the upper one earns a sell. Both bets expect a return toward the middle.
How to read the signals
The middle line is a plain twenty-bar average.
Band width tracks current conditions.
Marks appear only outside the envelope.
A trend pins price outside one band for a long run.
That run is where a fade tool struggles most.
Bands tighten sharply when the market goes quiet.
Alert channels in this build: popup, one message per closed bar.
Only one switch exists here. `EnableAlerts` starts on, and it raises a single terminal line for each closed bar that finishes outside the envelope. Nothing else in this build carries a message anywhere.
Every Ma Atr Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
MA_Period |
EMA period. Bars in the centre average, `20`. | 20 |
ATR_Period |
ATR period. Window behind the range figure, `14`. | 14 |
ATR_Mult |
ATR band multiplier. Ranges of width either side, `2.0`. | 2.0 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
One alert per closed bar. One message per closed bar, `true`. | on |

Settings that fit your chart
A fade tool wants a market that returns to its average. EURUSD H1 is the reference chart. Closes outside the envelope come a few times a week there. On M5 they arrive daily. On H4 they mark genuinely stretched moves.
When the Ma Atr Indicator fails
A trend keeps price outside one band for many bars.
Each of those bars can print a mark against the move.
The average lags, and so does the whole envelope.
Two ATR is narrow enough to reach often.
Copy the compiled Ma Atr Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Background reading on the method behind the Ma Atr Indicator: Moving average envelope on Wikipedia, Mean Reversion at BabyPips.
Download the Ma Atr Indicator for MT4 and MT5
The zip holds the compiled Ma Atr Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
Why does a close below Lower print a BUY?
Because the tool fades stretch rather than following it. It treats a close outside the envelope as an overextension likely to pull back toward the average, which reverses the reading a breakout tool would give.
What does ATR_Mult 2.0 set?
How far each band sits from the average, measured in current ranges. Two is close enough to be reached regularly; raising it to three makes marks rarer and each one describes a genuinely unusual close.
Is MA_Period 20 simple or exponential?
Exponential. The call asks for MODE_EMA, so recent closes carry more weight than older ones and the centre line turns a little faster than a simple average of the same length.
When does the ATR_Mult envelope mislead most?
In a sustained trend. Price then sits outside one band bar after bar, and each of those closes can print a mark pointing against the move, which is the known weakness of any fade approach.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Ma Atr Indicator as one input. Always backtest before trading live.
Category: this is part of our Trend collection. Next, plainly, truly, browse more Trend for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- The core method is documented in Indirect finance on Wikipedia.
- Additional market context is at Dow Jones Us Indices at StockCharts ChartSchool.
