As an example let us consider a 20 period SMA. The upper maximum value above today's close was (H-C)/20. The lower minimum was (C-L)/20.
If we consider today's range in % as: 100*(H-L)/C= 5%, it is interesting to note that the maximum range of possible crossing points fall within a relatively narrow 5% / 20 = 0,25% band. In numbers it would look like this (example).
H=10 doll
L=9,5 doll
error range: 0,5/20 = 0,025 doll (1/20 of the bar range)
To use this value in backtesting one could use the closing value of the SMA as the crossing point and consider the STDEV from it to have an idea of the size of possible error. Calculation for EMAs are not much more difficult.
Unfortunately I can only consider the idea theoretically. No scripting skills yet.
rgds
-geo-
Comment