Will an ordinary Moving average be able to determine the trend and at the same time be profitable? And if so, how effective will it be in comparison with other trend indicators. Most likely, this question has occurred to every trader familiar with technical analysis.

 

It's time to answer this question once and for all. In this article, we will check the indicator in action.:

 

 

  1. Let's create an expert for testing.
  2. Let's calculate the “RBTI” rating for the Moving Average indicator.
  3. To improve the result, let's try different variations of using the Moving Average.

 

 
 

What is the Moving Average in trading?

MovingAverage, MA, SMA is a technical analysis indicator based on averaging. The moving average is rightfully the Mother of all indicators. It is difficult to find a technical indicator that is not based on the principle of averaging.

 

To calculate the indicator value, you need to add up the closing prices of the last bars and divide the amount by the number of these bars. This is how the classic indicator is calculated. The full name of this calculation is "Simple Moving Average" or "SMA".

 

At the moment, there are a huge number of options for averaging the price range. In simple terms, the difference in calculations is the percentage that is taken from each specific bar. You should not delve into this too much, this knowledge is poorly correlated with the profit from trading. 

 

Below we have listed some varieties of the Moving Average. It is worth noting that these are not all existing options.

MovingAverage technical analysis indicator

The standard types of averaging include: 

• Simple averaging (SMA)

• Exponential averaging (EMA)

• Smoothed averaging (SMMA)

• Linearly-weighted average (LWMA)

 

To the advanced ones:

• Adaptive JMA of smoothing (JJMA)

• Ultralinear JRSX smoothings (JurX)

• Parabolic approximation (ParMA)

• Wilson's algorithm (T3)

• Variable Index Dynamic Average (VIDYA)

• Adaptive Moving Average (EMA)

 

To the rare:

• Digital filters

• Various kinds of complex approximations

• Options where the weights for each bar are determined by a neural network

 

Configurable parameters of the Moving Average

In this article, we are considering the classic Moving Average. In the form in which it is embedded in the MetaTrader 5 trading terminal. Here are its main parameters, sorted by their significance and influence on the indicator curve.


Period

The number of bars involved in calculating the average value.

It can take values from 1 to very large values (limited by the number of bars on the chart). This parameter has the biggest impact on the operation of the indicator. The higher this parameter, the slower the indicator line reacts to price changes.


Method

Here we have 4 averaging options: SMA, EMA, SSMA, LWMA. We will not go into the details of their calculation. When it comes down to it, we'll just sort them out in the MetaTrader 5 strategy tester.


The type of price to build

Closing price, Opening price, Maximum price for the period, Minimum price for the period, Median price (high+low)/2, Typical price (high+low+close)/3, Weighted average price (high+low+close+close)/4.

 

Offset

Shifts the indicator along the time line. It is poorly applicable for trend identification. At least that's what it seems intuitively. Anyway, we'll check that out too.


The main danger when trading on the Moving Average

Moving Average and failure of the forward test

When working with this indicator, you need to be very careful, because in fact, only time is included in its variability (period setting parameter). This means that when we select the best parameters of this indicator, we try to find a pattern in time cycles. Many trading gurus of the past decades have persistently discouraged attempts to use time cycles in predicting future stock prices. In his book, Larry Williams wrote: using time cycles to predict prices is a sure way to get into a madhouse.

In modern terms, trading systems with time cycle length selection do not pass the forward test, since there are no logically justified patterns in the length of the time cycle. Or simply put, they do not pass the test of the future.

Let's calculate the RBTI rating for the Moving Average indicator

The Moving Average is the result of working as a trend indicator

 

The moving average itself does not indicate the direction of the trend. Therefore, we will have to use interpretation. We looked at what they write on the Internet about this, and the most common is "the slope of the moving average perfectly shows the trend direction, use the MovingAverage direction to determine the trend." Well, to be honest, this is a pretty bold statement, and we'll check it first. So, Gold (XAUUSD), the H1 timeframe and 13 years of real history - let's go.

Let's select the parameters on the site for optimization and find IMP_opti.

The best parameters were: Period = 85, Mode = Simple, Price = Median Price. The results are disgusting even in the optimization area. IMP_opti = 0.81. Looking at the chart, I really don't want to participate in this with my money.

 
Moving Average test on the entire site

As expected, the test of the obtained parameters on the entire site looks very bad. The remnants of the tiny profits were finally wiped out. And on the reverse forward test section (where we have a very strong flat), the balance chart plunged into the abyss. In addition, the PC indicator (Prediction Coefficient) indicates that no real patterns have been found.

IMP_all = 0,06 

PC = 7%

RBTI = 0,43

 
 

We increase the efficiency of trend detection with the Moving Average indicator

Ways to identify a trend using the Moving Average indicator

In the previous test, we saw extremely poor performance. Let's try to increase it. We cannot change or improve the indicator, as it is the purpose of our test. This means that we will improve the way we interpret the Moving Average.

Let's add options for determining the trend: 

1) The price crosses the indicator line.

2) A shock bar, the entire price range of which is higher (or lower in the case of a sell transaction) than the indicator line.

3) The shadow touches the indicator line.

 

We will also give you the opportunity to use different trend interpretation methods for long and short positions.

 

We increase the efficiency of trend detection with the Moving Average indicator

Moving Average test with new trend identification methods

Already at the stage of parameter selection, we see a significant increase in the results - IMP_opti = 2.63. This is three times better than the previous result. The best indicator settings were: Period = 181, Mode = Simple, Price = Close, Shift = 2, Open BY Strategy = color change, Open SELL Strategy = ghost cross MA.

The Moving Average forward test with new trend identification methods

The flat section in the reverse forward test is still bad. But overall, the overall result was positive.

IMP_all = 0,55 

PC = 20%

RBTI = 1,59

Congratulations to the Moving Average indicator for assigning it an RBTI rating: 1.56

 

Conclusions

 

1) The Moving Average indicator is really capable of identifying a trend. Although it does it quite mediocre.

 

 2) The indicator is extremely unprofitable for long periods of consolidation and flat. 

 

3) For trend detection purposes, non-standard ways of interpreting the indicator readings gave the best result. 

 

4) Adding new ways of interpretation can improve the result several times.

 

5) The Moving Average indicator has been assigned an RBTI rating of 1.59. The result will be recorded in the leaderboard.

 

 

Downloads

Скачать эксперта для торгового терминала MetaTrader5

  • Expert for testsDownload the automatic Expert Advisor for the MetaTrader 5 trading terminal
  • Download the automatic Expert Advisor for the MetaTrader 5 trading terminal

Статья впервые опубликована: 17 April 2025

Дата последнего обновления: 18 April 2025