Generally speaking, the moving average smooths out price fluctuations, so traders can see which movements mark significant trends and which are just a regular part of price movement. Technical indicators such as these are incredibly versatile and can be used across all markets, no matter which assets you’re looking at.
But there’s much more to it than that and there are several different ways to calculate moving average. The two most common calculations are called the simple moving average (SMA), which is a straightforward average over a defined set of time periods, and the exponential moving average (EMA), which puts more weight on the more recent numbers.
So, for instance, we wanted to look at an asset’s 30-day SMA, we’d add up all the closing price of that asset for the last 30 days and divide by 30 (it is an average, after all). Each day, the oldest price would get bumped to make way for the most recent price.
Calculating the EMA, on the other hand, is a little bit more complicated. We’d use the formula EMA = (K x (C - P)) + P, where C is the current price, P is the previous period’s EMA (A SMA is used for the first periods' calculations), and K is the exponential smoothing constant. This smoothing constant applies a certain weight to the most recent price.
Since recent prices carry more weight in the EMA, it’s more sensitive to price fluctuations. This is both a strength and a weakness of this calculation — while it can help identify meaningful trends earlier, it’s also heavily influenced by short-term changes.
Whichever type of moving average you’re using, you’ll need to choose the time period it’ll cover. That could range from minutes to one month. No time period is necessarily better than another — each has its strengths and weaknesses, and each can be used for different purposes.
That brings us to the lag. Because moving averages are calculated using all the price points of the past and present, the number will lag a bit. The degree of said lag depends on the length of the time period you’re monitoring. For example, a 10-day moving average would have a much smaller lag than a 100-day moving average, since each new price point carries 10 times the significance.
You’ll typically want to use lengthier moving averages to look at longer-term trends. So, bearing that in mind: a 200-day moving average is much better for assessing long-term trends, while a 50-day moving average will help identify intermediate trends.
Of course, at Capitalise we make calculating the moving average completely math-free for you. Just type it into the Wizard and the platform will automatically incorporate it into your strategy.
Within the Wizard, you’ll notice a few options when you set your moving average. First is the NoOfBars, which defines the number of bars that you want to include in your calculation. Then there’s the BarPeriod, which determines how frequently the value is updated. So, a daily bar period is updated once per day, while a 15-minute bar period is updated every 15 minutes. Last is the BarPrice, which will reflect the MA based on either the open or close price of the candle.
Keep on Capitalising!