Alan Ross

Alan Ross Forex

Free Forex Indicators, MetaTrader Tools and Honest Trading Guides

Learn Forex

ATR Oscillator Settings for MT4: 60 of 89 Settings Made Money, None on EURUSD M5, and the First-Half Winner Finished Last on 3 of 4 Charts

Key takeaways

  • MT4 has no ATR oscillator built in. You can read it by dropping two ATR lines into one window, or add a short custom indicator that divides a fast ATR by a slow one and draws a level at 1. Both ways are below.
  • I tested 24 settings, fast ATR 3, 5, 7 or 10, slow ATR 30, 50 or 100, threshold 1.0 or 1.2, as a filter on the EMA 9/21 cross. EURUSD and gold, M5 and M15: 89 settings with 30 or more trades, 60 made money after cost.
  • None of the 24 made money on EURUSD M5. On gold M5, 23 of 24 did, but the same cross with no filter made money there too.
  • Only 32 of 89 made money in both halves of the data, 16 of them with the slow ATR at 100.
  • Picking the best setting on the first half failed. The first-half winner finished last in the second half on EURUSD M5, EURUSD M15 and gold M15, and 21st of 24 on gold M5.

The ATR oscillator is easy to describe and slightly awkward to set up in MetaTrader, because neither MT4 nor MT5 ships one. Most guides then pick a pair of periods, say ATR(5) and ATR(50), and move on without saying why those two.

This guide shows two ways to put it on a chart, then what 24 period and threshold combinations did on the same data I use for every test on this blog.

How do you add an ATR oscillator to MT4?

MetaTrader on a laptop, with two Average True Range lines in one window

The quick way, no code:

  1. Insert, Indicators, Oscillators, Average True Range. Period 5. It opens in its own window.
  2. Drag a second Average True Range from the Navigator into that same window. Period 50, a different colour. In the Scale tab tick “Inherit scale” so both lines share one axis.
  3. When the period 5 line is above the period 50 line, the oscillator is above 1. That is all the ratio says.

The cleaner way, one line with a level at 1: in MT4 open MetaEditor (F4), File, New, Custom Indicator, name it ATR_Oscillator, and replace the code with this:

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
#property indicator_level1 1.0
#property indicator_level2 1.2
input int FastATR = 5;
input int SlowATR = 50;
double Osc[];

int OnInit() {
   SetIndexBuffer(0, Osc);
   SetIndexStyle(0, DRAW_LINE);
   return(INIT_SUCCEEDED);
}

int OnCalculate(const int rates_total, const int prev_calculated,
                const datetime &time[], const double &open[], const double &high[],
                const double &low[], const double &close[], const long &tick_volume[],
                const long &volume[], const int &spread[]) {
   int limit = rates_total - prev_calculated;
   if (prev_calculated > 0) limit++;
   if (limit > rates_total - SlowATR - 1) limit = rates_total - SlowATR - 1;
   for (int i = limit; i >= 0; i--) {
      double slow = iATR(NULL, 0, SlowATR, i);
      Osc[i] = slow > 0 ? iATR(NULL, 0, FastATR, i) / slow : EMPTY_VALUE;
   }
   return(rates_total);
}

Press Compile, then drag ATR_Oscillator from Navigator, Indicators onto the chart. The dotted levels at 1.0 and 1.2 are the two thresholds I tested. In MT5 the built-in ATR works the same way for the quick method; the custom version needs MT5’s handle-based iATR, so the drag-two-lines method is simpler there.

One detail: MetaTrader’s ATR averages the true range with a simple average, while my tests use Wilder’s smoothing, the original definition. On a 5 or 50 bar ATR the two lines sit very close, but readings right at 1.00 can differ. More on ATR periods in ATR indicator settings for MT4.

How do you read the ATR oscillator in MT4?

A trader setting fast and slow ATR periods for an oscillator in MT4
What you seeWhat it meansWhat it does not mean
Line above 1The last 5 bars were wider than the last 50That the trend will continue: price carried on 44% to 55% of the time at every reading
Line above 1.2A clear volatility burst, about 1 bar in 5A bigger move in ATR terms: the next 24 bars were smaller in ATR on all four charts
Line below 1The market has gone quieter than usualA worse trade: on EURUSD M5 these crosses lost less
Line risingVolatility picking up from a low baseA stable filter: it was the best and the worst filter depending on the chart

The numbers behind the right-hand column are in ATR oscillator tested as a trend filter.

Which settings were tested?

  • Signal: the EMA 9/21 cross on the close, taken only when the oscillator is above the threshold at that bar.
  • 24 settings: fast ATR 3, 5, 7, 10 × slow ATR 30, 50, 100 × threshold 1.0, 1.2.
  • Data: EURUSD M5 from June 3 to August 26, 2026, 16,926 bars; gold M5 from June 16 to August 26, 13,736 bars. M15 built from the same bars.
  • Exit and cost: stop 1.5 ATR, target 3 ATR, 48 bars at most, one trade at a time; 1 pip on EURUSD, $0.30 an ounce on gold.
  • A setting is counted only with 30 or more trades: 89 of the 96 setting-and-chart cells.

How many ATR oscillator settings made money?

EURUSD M5EURUSD M15Gold M5Gold M15
EMA cross, no filter-1.68 (606)+0.33 (173)+1.16 (366)+0.60 (118)
Settings with 30+ trades24232418
Made money after cost0192318
Made money in both halves017411
Beat the unfiltered cross14191417
Best setting10/30 >1.2: -0.97 (102)10/100 >1.2: +2.99 (35)10/100 >1.0: +2.09 (173)5/30 >1.2: +7.13 (31)
Worst setting7/30 >1.0: -1.88 (356)5/50 >1.2: -0.64 (51)3/30 >1.0: -0.08 (227)3/30 >1.0: +0.55 (77)

Profit per trade after cost: pips on EURUSD, dollars an ounce on gold. Trades in brackets.

The row that matters is the first one. Where the plain EMA cross lost, on EURUSD M5, no oscillator setting made it profitable: all 24 lost between 0.97 and 1.88 pips a trade. Where the plain cross already made money, most settings did too. The oscillator moved results around a base that was set by the market, not by the filter. The same pattern, where the chart decides more than the setting, is in gold vs EURUSD with one rule.

“Beat the unfiltered cross” looks impressive at 64 of 89. Part of that is cost: a filter that halves the trades halves the spread bill. On EURUSD M5, 14 settings beat the plain cross and every one of them still lost money.

Did any part of the setting matter?

Made money in both halvesEURUSD M5EURUSD M15Gold M5Gold M15Total
Slow ATR 300 of 85 of 70 of 82 of 67 of 29
Slow ATR 500 of 86 of 80 of 83 of 69 of 30
Slow ATR 1000 of 86 of 84 of 86 of 616 of 30
Threshold 1.00 of 1212 of 121 of 125 of 1218 of 48
Threshold 1.20 of 125 of 113 of 126 of 614 of 41

The slow ATR of 100 was the most consistent: 16 of 30 settings made money in both halves, against 7 of 29 for 30. A long slow ATR changes less from bar to bar, so the ratio reacts to real bursts rather than to every busy hour. The threshold flipped between charts: 1.0 was better on EURUSD M15, 1.2 on gold M15.

Does the best first-half setting keep working?

ChartBest on first halfFirst halfSecond halfRank in second half
EURUSD M510/30 >1.2+0.79-2.7324 of 24
EURUSD M1510/100 >1.2+6.21-1.3123 of 23
Gold M57/100 >1.2+1.46+1.5721 of 24
Gold M153/50 >1.0+2.58+1.136 of 6

Settings with at least 15 trades in each half. Gold M15 had only 6 such settings.

This is the test that matches real use: you look at past data, pick the best setting, trade it. The first-half winner was the very last setting in the second half on three of four charts. On EURUSD M5 it went from the best first half in the grid, one of only two in profit, to the worst second half. On gold it stayed in profit, as nearly everything on gold did, but ranked near the bottom. I saw the same thing with MACD filters in MACD crossover rules backtested and with moving averages in the moving average crossover test.

Which ATR oscillator setting should you use in MT4?

  • If you use one, use a long slow ATR. 5/100 or 10/100 held up in both halves more often than anything with 30 or 50.
  • Do not expect it to fix a losing signal. On EURUSD M5 all 24 settings lost.
  • Do not tune it on past data. The first-half winner finished last on three of four charts.
  • Use it for size, not for timing. A high reading means wider bars, which matters for where your stop goes, as in fixed vs ATR stop. It did not say which way price would go.
  • Save it with the rest of your setup. The template steps are in multi-indicator MT4 template.

How the oscillator compares with ADX is in ATR oscillator vs ADX.

Frequently asked questions

Does MT4 have an ATR oscillator?

No. Put two Average True Range lines, periods 5 and 50, in one window, or compile the short custom indicator above, which draws the ratio with levels at 1.0 and 1.2.

What are the best ATR oscillator settings?

None held up in a stable way. The slow ATR of 100 made money in both halves most often, 16 of 30 settings, but the first-half winner finished last in the second half on three of four charts.

Does the ATR oscillator work on EURUSD?

On EURUSD M5 all 24 settings lost between 0.97 and 1.88 pips a trade. On EURUSD M15 19 of 23 made money, but so did the plain EMA cross without any filter.

What threshold should I use, 1.0 or 1.2?

It depended on the chart: 1.0 made money in both halves on all 12 EURUSD M15 settings, 1.2 on all 6 gold M15 settings that had enough trades.

Is the ATR oscillator the same as ATR?

It is two ATRs divided by each other. ATR says how wide bars are in pips; the oscillator says whether they are wider than usual.

Want a trend line that does not need two ATRs to agree?

It is my own enhanced DeMARK Trend Line indicator for MetaTrader 4 and 5. Non repaint, clean, and free.

Download the Free DeMARK Indicator

Written by Alan Ross

Forex trader and MetaTrader indicator developer. I build and test MT4 and MT5 tools, then write the honest version of how they actually work. More about me.

Last reviewed October 2026
Alan Ross
Alan Ross

Forex educator and indicator developer. I build and trade my own MetaTrader tools, and share the ones that genuinely help.

Leave a comment

Your email address will not be published. Comments are reviewed before they appear.