Three Moving Average Parameters
So you want to add a moving average on your charts. What are the parameters you have to set or choose? There are only a few (three):
- The prices that will be used for calculating the average: close, average of high and low, average of high, low, and close, etc.
- The length of the period of the moving average – how many bars will be used for calculating the moving average, or in other words how many bars back we want to look at every moment.
- Type of moving average – the formula used: simple vs. exponential vs. other types.
Let’s now explore each of the parameters.
Parameter 1: Price Used for Moving Average Calculation
Most typically people use every bar’s closing price to calculate moving averages. In many cases this is justified by the special role the closing price has. For example, every day’s closing price of a stock index represents the stock market’s consensus at the end of that trading day, when traders are closing their intraday positions and preparing their portfolios for the night when they will not be looking at the market.
On the other hand, closing prices of bars are much less significant on intraday charts – the information regarding at which price the market was trading exactly at the end of a particular 5 or 10 minute period during the day has little meaning for most market participants. Therefore you can look at alternative methods of calculating moving averages when you are working with intraday data: moving averages can be calculated from the averages of high and low of each bar, or from the so-called typical price (the average of high, low, and close), or from the average of all four prices (open, high, low, and close).
See more details in Calculating Moving Average from Close and the Other Methods.
Parameter 2: Moving Average Period Length
The length of the moving average or more precisely the number of bars included in the moving average calculation is probably the most discussed of the three parameters. You can calculate moving average from just a few (e.g. 8) most recent price bars and you will see that it reacts very quickly to every little change in the market’s direction. Alternatively, you can include tens or hundreds of price bars in the calculation (e.g. 200 bars is a popular setup). This way you will filter out all the bar-to-bar noise – the long period moving average will reflect only the meaningful, long-term price trends.
Besides looking at the number of bars, you naturally also have to take into consideration how long each bar is. While 10 bars represent 2 weeks on a daily chart, they are less than one hour on a 5 minute chart.
There is no ideal moving average period length, as different trading styles and strategies require looking at different information. The problem of finding a good moving average period was discussed here: Moving Average Period.
Parameter 3: Moving Average Type
The most common moving average type is simple moving average. As its name suggests, it is also the simplest one to calculate and understand (that’s probably the main reason why it’s the most popular). Simple moving average is (simply) the arithmetic average of the last N bars (N is the moving average period discussed above). You sum up N most recent prices and divide the result by N.
Besides simple moving average, there are other types. There are only little variations in the formulas and sometimes it is difficult to tell which type of moving average it is just by looking at a chart. For example, exponential moving average puts more weight to the most recent prices and therefore it appears to be reacting a bit faster to price changes compared to the simple moving average. Other frequently used moving average types include least-square moving average, adaptive moving average, or weighted moving average. If you are creative and good with numbers, you can even design your own proprietary methods (nevertheless, the usefulness of such effort is questionable, given the little differences and little extra information you get).
Which Moving Average Parameters to Use?
If you have not done much quantitative testing and have no idea which moving average calculation method may be effective for your trading approach, I would suggest you start with the very basic. Take simple moving average calculated from closing prices (this is the setup your charting software most likely has as default) and focus your energy on finding a good moving average period length. Also keep in mind that moving average is just one tool, just one piece of the analysis, and you will probably need to include other things (like the fundamentals, volume, or price action) into your decision making to build a sound trading strategy.