I am writing a script to scan ASX shares to find which have their 6EMA cross the 10SMA in a certain date range. I found an example script in the knowledgebase which to my thinking produced the results I would expect. It was:
In the following example the script is looking for each 25EMA crossing above a 50EMA since the 1st of January 2008.
V1 = MA(BARS=25, STYLE=Exponential) ;
V2 = MA(BARS=50, STYLE=Exponential) ;
V3 = V1 CrossesAbove V2 ;
ACC(V3,RANGE=Look Back Period, BACKTYPE=Date, STARTDATE=2008-01-01)
Adapting some of the parameters, I wrote:
v1=MA(BARS=6, STYLE=Exponential);
v2=MA(BARS=10);
v3 = v1 CrossesAbove v2;
ACC(v3,RANGE=Look Back Period, BACKTYPE=Date, STARTDATE=2022-08-23)
Scanning with this script produced several hundred results from all the ASX shares. However, picking one at random to validate the result, it was obvious that the resulting chart was not the expected outcome of the script (see the attached image).
From the attached image, I would have expected that the chart would not be included in the result because:
(a) The 6EMA is actually below the 10SMA.
(b) There was no crossing of the 6EMA and 10SMA between 23 Aug and the last day (26 Aug).
Any suggestions on what I am doing wrong?