Will Today’s Close Cross a Moving Average, from Kim Zussman
Starting with an example, assume yesterday's close was above the simple 10D moving average: will today's close be below the 10D moving average?
Two things change from yesterday to today - today's close will be added to the series, and the close 10 days ago which was part of the moving average will be dropped (as it becomes 11 days ago).
C1 = today's close
C2 = yesterday's close
C10 = close 10 days ago
MAt = 10DMA as of today
MAt = sum(C10:C1)/10 (sum of C10 through C1)
The statement that "today's close < MAt " can be written
C1 < sum(C10:C1)/10
10C1 < sum(C10:C1)
10C1 < C1 + sum(C10:C2) ( Using: sum(C10:C1) = C1 + sum(C10:C2) )
9C1 < sum(C10:C2)
C1 < sum(C10:C2)/9
The right hand side is the 9 day moving average as of yesterday.
Thus today's close is below the ten day moving average if and only if today's close is below yesterday's 9 day moving average.