I want to calculate the 10-day SMA of a stock. However, there are some trading days when no trades took place for the stock (i.e. volume is zero). For the days that have zero volume, what is the stock price that should be used to calculate the SMA? Is it the closing price of the previous day that had a trade? Or is it $0?
It might depend on what you're using the SMA for, but I certainly wouldn't use zero.
I can see two viable options - the most intuitive to me is to use the prior closing price for the days on which there are no trades. That would cause the SMA to converge to the last price over 10 days.
Another option might be to use the prices for the past 10 days on which there were trades. That would cause the the SMA to be "flat" until the day after a trade).