# Introduction

Prediction, modeling and trading is becoming a more complicated challenge because in all these steps a large number of factors intervene that directly influence the behavior of the market. Therefore, there is a desire to continue developing new computational techniques, that help investors to enter the market with more guarantees. Thus, technical indicators are chart analysis tools that can help trades market operators to understand and act on the movements of the future evolution of the prices of a financial asset. So in this article we will present the Moving Average Indicator and its importance for trend analysis .

The goal when using indicators is to identify trading opportunities. Applying the moving average strategy to a price chart allows traders to identify areas where the trend changes the direction creating a potential trading opportunity .

# Technical Indicators

A technical indicator is a mathematical calculation based on a series of data of the historical price or volume of the market (previous quotes) with the aim of producing another series of data, that will be analyzed to establish trading rules or simply to observe trends. There are four types of technical indicators used in the market and they are the following :

• Oscillators: compare prices over time. Normally, the closing prices of a session are compared with the closing prices of previous sessions. Based on this concept, a multitude of trading rules can be established. Oscillators are often used when there is a lateral trend in the market, that is, there is no upward or downward direction. For this, the indicator is presented between an upper and a lower level, in such a way that when any of them is exceeded, it can be indicative of a buy or sell signal. Examples of oscillators are the Momentum, Relative Strength Index (RSI or Relative Strength Index) and Stochastic indicators, among many others [3,6].
• Volatility indicators: as their name suggests, they are a measure of the amount and speed at which prices change, regardless of direction. These indicators provide the information to know how long it may take for a security to change direction in order to establish the right moment in which to carry out an operation. Some indicators of this type are Bollinger Bands, Keltner Bands, among others [1,3].
• Volume indicators: show for each moment the amount of money moved for a specific value, that is, the sum of money from purchases and sales. These indicators show the health of a security, since the more volume there is, it means that the greater the confidence to operate with that security. Although this does not always mean that it is a good time to trade, there will lie the ability of the trader together with the use of other indicators to determine whether to enter or exit the market. Some examples of indicators of this type are Volume on Balance or Accumulation / Distribution .
• Trend indicators: try to identify trends and determine their strength. These indicators analyze prices over time to determine averages. They allow you to obtain graphs that smooth the price peaks when dealing with averages for different periods, in such a way that locating trends is easier. Indicators of this type are: Moving Average (MA or Moving Averages), Moving Average Convergence Divergence (MACD or Convergent Divergent Moving Average) and Average Directional Index (ADX or Directional Average Index) that serves to measure the strength of a trend .

# Moving Average Trend Indicator

A moving average, also called as rolling average or running average is a used to analyze the time-series data by calculating a series of averages of the different subsets of full dataset. So, a moving average (MA) is a technical tool that provides an average of the price over a specific period of time. They are used to filter out market noise and make sense of the trend by eliminating minor movements that would mask what the market is actually doing. Its use is for the detection of trends but they are also useful for the analysis of the evolution of the price in different periods of time. This time-lagged indicator follows price action, eliminates market noise, and smoothes prices to more easily determine the direction of the asset under study.

Thus, they are nothing more than the moving average, and to calculate it, the last periods that we have parameterized for its calculation are taken, for example a moving average of 20 periods, the last 20 data from the closing of the price are taken and its half. Its representation is a line on the chart (See Figure 1), the noise is more filtered, the movements of the (MA) are smoother than the next price movements. The (MA) is always delayed, which is the result of performing a calculation on the prices of the past, they do not predict only a more clear summary of what has happened, the usefulness is that they help us detect trends and when there are trends it is more likely that this I continued, the shorter the (MA) calculation period, the less delay it will have but it will contain much more noise than the (MA) that take a longer period, of course but take longer to react to recent market changes. There are several moving averages, but the most popular are simple and exponential. **Figure 1: Moving Average of 20 and 50 Period**

# Simple Moving Average:

All data for the period are weighted equally, have the same weight and are given the same importance as the first day as the last, of which an average is simply taken. Act more slowly to adapt to the most recent price changes.

The formula for calculating the SMA is straightforward :

The simple moving average = (sum of the an asset price over the past n periods) / (number of periods)

Where:

So, in this chart (See figure 2) uses two moving averages, a faster moving average(short-term)) and a slower (long-term) moving average. The faster moving average 20 day period while the slower moving average can be 50 day period.

A short term moving average is faster because it only considers prices over short period of time and is thus more reactive to daily price changes. On the other hand, a long term) moving average is deemed slower as it encapsulates prices over a longer period and is more lethargic . A moving average, as a line by itself, is often overlaid in price charts to indicate price trends. A crossover occurs when a faster moving average (i.e. a shorter period moving average crosses) a slower moving average (i.e. a longer period moving average). In stock trading, this meeting point can be used as a potential indicator to buy or sell an asset.

When the short term moving average crosses above the long term) moving average(media), this indicates a buy signal .

Contrary, when the short term moving average crosses) below) the long term moving average, it may be a good moment to sell . Figure 2: Simple Moving Average of 20 and 50 Periods

# Exponential Moving Average:

An additional value is taken to the selected period, that is, for an (EMA) of 20 periods, the last 21 are considered, the new price is weighted in% much more while the others weight everything equally (See figure two).

So, (EMA) give more weight to the most recent periods. This makes them more reliable than (SMAs) as they are comparatively better representation of the recent performance of the asset .

The EMA is calculated as :

Where:

So, in this chart (See figure 2) uses two moving averages, a faster moving average (short-term) and a slower (long-term) moving average. The faster moving average 20 day period while the slower moving average can be 50 day period.

Figure 3: Exponential Moving Average of 20 and 50 Periods

So, must choose the one that best fits on the chart depending on which best fits what you want to see, it is worth knowing that a simple moving average is weaker than an exponential average, the only thing that matters in the adjustment of a moving average is that you like how it looks on your particular chart. To incorporate (MA) into trading strategies, it is important to indicate that they act as Dynamic Support and Resistances, that is, when the price is in a trend, it behaves as a trend line marking the guideline, it also has the logical quality of attracting the placed price. They are still an average of the price and by the statistical principle that everything returns to its average in a moment the price always tends to approach any moving average that has been plotted on the chart. These two properties can be used in our trading strategy. Another utility of the (MA) is that they use them to detect the extreme of the price, since all the data of a distribution tend to cluster around its mean, if a strong impulse moves the price away from the (MA) at some point this the price will return to its mean This will help us to detect the end of the market. That is, when the price is far from its average and the trend may be ready to make a correction. To adjust a (MA) and parameterize its timing in trading, you need to understand is that every (MA) is still a line chart of price in a higher timing and this is where its usefulness lies. However, a 5 period is equivalent to the line graph of multiplying that temporality * 5, that is, if we are in one minute it is equivalent to the 5 minute line graph, if it were 60 periods it would be the one hour line graph. So to say that (MA) you need you must say in what time frame your operations will be or rather what time context you have your operations in.

# Conclusions

The Moving Averages are the simplest indicators to use but it is important to know their limitations and their utilities, it will help us to maintain the context of the trend of the different time frames, in addition to detecting the extremes of the market and when it is ready to correct for be overbought or oversold. Let us remember that no (MA) or parameter is better than another and no matter how many (MA) you add to the graph, you will never be able to attenuate or completely eliminate its limitations, it is best to choose a simple (MA) with some simple parameters, in such a way as to incorporate them into our own systems of trading.

References

• CobuildLab 2021. Technical Indicators for Trading.
• Generating Trade Signals using Moving Average (MA) Crossover Strategy. Towardsdatascience 2020.
• A.-M. Baiynd, «The Trading Book: A Complete Solution to Mastering Technical Systems and Trading Psychology,» McGraw-Hill, p. 272.
• I. Staff. Available: HYPERLINK "http://www.investopedia.com/articles/technical/070301.asp"