SMMA (i-1) - smoothed moving average of the previous bar PREVSUM - smoothed sum of the previous bar SUM1 - total sum of closing prices for N periods it is counted from the previous bar SMMA (i) = (PREVSUM - SMMA (i - 1) + CLOSE (i)) / N Succeeding moving averages are calculated according to the below formula: The second moving average is calculated according to this formula: The first value of this smoothed moving average is calculated as the simple moving average (SMA): P - the percentage of using the price value. P-percent exponential moving average will look like:ĮMA = (CLOSE (i) * P) + (EMA (i - 1) * (1 - P))ĮMA (i - 1) - value of the Moving Average of a preceding period With exponentially smoothed moving averages, the latest close prices are of more value. Exponential Moving Average (EMA) #Įxponentially smoothed moving average is calculated by adding of a certain share of the current closing price to the previous value of the moving average. This value is then divided by the number of such periods. Simple, in other words, arithmetical moving average is calculated by summing up the prices of instrument closure over a certain number of single periods (for instance, 12 hours). You can test the trade signals of this indicator by creating an Expert Advisor in MQL5 Wizard.Ĭalculation Simple Moving Average (SMA) # Here are the types of moving averages on the chart: That is where the interpretation of indicator moving averages is similar to the interpretation of price moving averages: if the indicator rises above its moving average, that means that the ascending indicator movement is likely to continue: if the indicator falls below its moving average, this means that it is likely to continue going downward. Moving averages may also be applied to indicators.
It allows to act according to the following trend: to buy soon after the prices reach the bottom, and to sell soon after the prices have reached their peak. This trading system, which is based on the moving average, is not designed to provide entrance into the market right in its lowest point, and its exit right on the peak. When the instrument price rises above its moving average, a buy signal appears, if the price falls below its moving average, what we have is a sell signal. The most common way to interpreting the price moving average is to compare its dynamics to the price action. Exponential Moving Average and Linear Weighted Moving Average attach more value to the latest prices. In case we are talking of Simple Moving Average, all prices of the time period in question are equal in value. The only thing where moving averages of different types diverge considerably from each other, is when weight coefficients, which are assigned to the latest data, are different. It is often the case when double moving averages are used. Moving Average may be calculated for any sequential data set, including opening and closing prices, highest and lowest prices, trading volume or any other indicators. There are four different types of moving averages: Simple (also referred to as Arithmetic), Exponential, Smoothed and Weighted. As the price changes, its moving average either increases, or decreases.
When one calculates the moving average, one averages out the instrument price for this time period. The Moving Average Technical Indicator shows the mean instrument price value for a certain period of time.