Why, when using a negative offset DMA, do my results not match the charts?
To answer this, it is important to understand how a negative offset DMA works. As an example, look at the DMA(28,-14). This measure will take current value of the MA(28) and shift it back on the chart by 14 days. Without data from the future, it is very clear that this creates a problem for the most recent 13 days of the measure.
The DMA(N,-P) is computed by taking the MA(N) and effectively "moving it back in time" by P days. Since we don't carry data from the future, it is not possible to compute a N-day average for the remaining P-1 days. For each of these dates, X[i], we compute shorter N-(P-i) day averages; where i=0 ... P-1 (i.e. X is the most recent date and X[P-1] is the point P-1 days ago on the chart.)
To illustrate the above. Notice that the DMA(28,-14) is the same as the MA(14) on the final date of the chart. Additionally, the DMA(28,-14) 8 days ago is the same as a MA(22).
show stocks where close is between 5 and 10
and draw DMA(28,-14)
and draw MA(28)
and draw MA(22)
and draw MA(14)
and add column MA(14)
and add column DMA(28,-14)
and add column MA(22)
and add column DMA(28,-14) 8 days ago
and draw price line at DMA(28,-14) 8 days ago
Copyright 2016 - Vestyl Software L.L.C.•Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus