The mathematical formula looks like this:
The calculation for the SMA is the same as computing an average or mean. That is, the SMA for any given number of time periods is simply the sum of closing prices for that number of time periods, divided by that same number.
The calculation for the SMA is the same as computing an average or mean. That is, the SMA for any given number of time periods is simply the sum of closing prices for that number of time periods, divided by that same number.