|
Simple moving averages are initially calculated by starting with the left most period in the data and adding up the specified prices (open, high, low, close, mid-point, or average) for the chosen number of periods. This total is then divided by the number of periods set in the Parameters menu.
Formula:
Where:
n = number of bars
Pt = selected calculation price
Pt-1 = selected calculation price 1 period ago
Pt-n = selected calculation price n periods ago
This calculation can be simplified for all but the first point. Rather than using all prices to calculate each moving average value, the oldest price can be subtracted from the running total. The newest price can then be added to the difference. The resulting sum is then divided by the number of periods. The quotient is the new point, or simple moving average.
Formula:
Where:
n = number of bars
MAt-1 = previous moving average value
Pt = current price
Pt-n = oldest price in series