I don't actually take a SMA values, I'm looking at percent changes over a certain time period, and the exact windows are rather arbitrary and simply meant to give you different time scales.
The distribution days are calculated as -.25 per week as IBD suggests deleting a distribution day every month. A better way to have done the rally days in hindsight would be a rolling list that would store the number of rally days in the past 7-11 days, but that's why I currently have it at an eleven day time scale.
Strictly speaking the +.5 days are not part of IBD's rules, but I added them since the model tended to be out of the market for long periods of time. According to IBD rules, this is how one would calculate a rally day: "Follow-through day variables include: an index closing sufficiently above 1% on increased volume, positive behavior of leading stocks, and improved market action regarding support vs. resistance levels. The most powerful follow-through days often happen Day 4 through Day 7 of an attempted rally.
In the wake of a follow-through day, the market should continue to add gains in strong volume, with breakouts by top stocks. This is further confirmation a new uptrend is underway."
However, I wanted to be a bit more aggressive in entering the S&P as this was part of a different algorithm where I originally wanted to use it as a forward indicator to predict market tops and bottoms.