MQL5 TUTORIAL – Simple Moving Average – Do I need an SMA for my trading strategy?


What is a simple moving average?

A simple moving average (SMA) is a basic technical analysis indicator commonly used in financial markets. It is a calculation of average price over a certain period of time, where each data point is given equal weight. The SMA is a widely used tool for traders and investors, as it can help to identify trends and potential opportunities. For example, a trader may use a 50-day SMA to determine an overall trend in a stock’s price. If the stock’s price is consistently above the SMA line, it may indicate a bullish market trend. Conversely, a trader may interpret a stock’s price consistently below the SMA line as a bearish trend. The SMA can be customized to fit different timeframes and periods, making it a versatile tool in technical analysis. While SMA is a relatively simple indicator, it can be a valuable tool for investors and traders to help identify potential trading opportunities. Moving averages are an important analytical tool used to identify current price trends and the potential for a change in an established trend. The utilization of moving averages is significant in the realm of analysis as it enables recognition of the present price tendencies and likelihood of a shift in a preexisting trend.

Why should I use a simple moving average?

As an aspiring trader or investor, you might wonder why you should use a simple moving average (SMA). The answer lies in the usefulness of this technical tool in identifying trends in the market. By calculating the average price of an asset over a specific period, SMAs give a clear picture of its movement and direction. This makes it easy to understand the overall trend and take advantage of potential opportunities. Moreover, SMAs are widely used by thousands of traders across multiple markets, making it a reliable and trusted tool in the trading community. By utilizing SMAs, you gain greater insight into market movements and improve your chances of making profitable trades.

What is the best setting for Simple moving average?

When it comes to determining the best setting for a simple moving average, there is no one-size-fits-all answer. This is because the optimal settings for an SMA depend largely on your personal trading strategy as well as whether you’re focused on long-term or short-term trading. For example, a day trader may find that a 15 or 20-day SMA provides the best signals for making quick decisions given the volatility of intraday price movements. On the other hand, for those focused on longer-term trades, a higher SMA setting between 50 and 200 days (the 200-day SMA is popular) can help capture long-term trends more effectively. In short, the best setting will depend on factors like the timeframe of trades, the market being traded, and the level of volatility. Ultimately, finding the optimal SMA setting requires trial and error, as different traders will have different preferences and goals when using moving averages.


Should I use a simple or exponential moving average?

The decision to use a simple or exponential moving average depends on the individual trader’s strategy and goals. Simple moving averages weight all candles equally, providing a smoother and less responsive signal. In contrast, EMAs put a higher weight on current candles, making them more responsive to recent price movements. If a trader believes that current events are more important in predicting future price movements, then an EMA may be preferred over an SMA. However, if a trader is looking for a more long-term trend signal, a simple moving average may be more appropriate. Ultimately, traders should experiment with both types of moving averages and decide which one works best for their trading style and goals.

What is a weighted moving average?

A weighted moving average is a common technique used in statistical analysis to smooth out a data set. It is a type of moving average where different time periods are assigned different weights in the calculation. This is in contrast to a simple moving average (SMA) which assigns equal weight to all time periods. The weights assigned in a weighted moving average can be based on various factors such as importance and relevance of data points. The exponential moving average (EMA) is also a type of weighted moving average, where more weight is given to recent data points. The purpose of using a weighted moving average is to reduce the effect of noise or outliers in the data and provide a clearer trend analysis.

What is a crossover strategy?

Using two moving averages in combination can result in the creation of signals indicating crossovers.
When calculating crossover signals, it is possible to employ a combination of two distinct moving averages.
A bullish crossover occurs when the shorter moving average crosses above the longer moving average. This is also known as a golden cross.

A bearish crossover occurs when the shorter moving average crosses below the longer moving average.

A crossover can indicate an uptrend or a downtrend. Price action and price movement for the SMA can be calculated by adding

Multiple moving averages can be used to confirm trends

Multiple moving averages can be a great tool to confirm long term trends. Using 3 or more moving averages, such as the popular triple SMA (Simple Moving Average) strategy, can help to smooth out short term volatility and provide a clearer picture of the direction of the market. By plotting the moving averages on a chart, traders can identify when they cross over each other, indicating a potential change in trend direction. If the prices are consistently trading above the moving averages, it suggests a bullish trend, whereas if the prices are consistently trading below the moving averages, it indicates a bearish trend. Overall, incorporating multiple moving averages into technical analysis can lead to better decision making and more accurate trading strategies.

How do I calculate a Simple Moving Average (SMA)?

The SMA is calculated by taking the average price of an asset over a specified time period. The formula for calculating the SMA is simple; all you need to do is add the closing prices of the asset for the specified period and divide the total by the number of periods. For example, to calculate a 10-day SMA, you would add the closing prices of the asset for the last 10 days and divide by 10. This will give you the value of the SMA for the 10-day period. The SMA is a useful tool for traders and investors to identify trends in the market and make informed decisions. It is important to note that the SMA is a lagging indicator and should be used in conjunction with other technical analysis tools for a more comprehensive analysis.


Wether you use SMA crosses to detect long-term price changes with a long-term SMA in the current trend, or to detect short term fluctuation with another moving average, or even to identify support or resistance, an SMA is one good tool that you might want to add to your trading toolbox.