{EMA Status Count Reset}
{Col A: Last
Day}
{Reset GV
counter}
A:=ExtFml("GV.SetVar","CountU",0);
{Store last day
parameter}
ExtFml("GV.SetVar","RunD",LastValue(DayOfMonth()));
{Col B:
LastMnth}
{Store last month
parameter}
ExtFml("GV.SetVar","RunM",LastValue(Month()));
{Col C:
LastYear}
{Store last year
parameter}
ExtFml("GV.SetVar","RunY",LastValue(Year()));
Filter enabled No
Periodicity Daily
Records required 500
{EMA Status Count
Scan}
{ColA:
Counter}
{Count securities above 50-day EMA}
{Date
variables}
D:=DayOfMonth();
M:=Month(); Y:=Year();
LD:=LastValue(D);
LM:=LastValue(M);
{_expression_ to check against
price}
MA:=Mov(C,50,E);
{Count securities meeting test
conditions}
Count:=LastValue(ExtFml("GV.GetVar","CountU"));
RunD:=ExtFml("GV.GetVar","RunD");
RunM:=ExtFml("GV.GetVar","RunM");
RunY:=ExtFml("GV.GetVar","RunY");
Date:=RunD=D AND RunM=M
AND RunY=Y;
Test:=LastValue(Date AND
C>MA AND V>0);
NewCount:=If(Test,{Then}
Count+1,{Else} Count);
ExtFml("GV.SetVar","CountU",NewCount);
{ColB:
Status}
{Mark securities above 50-day
EMA}
{Date
variables}
D:=DayOfMonth();
M:=Month(); Y:=Year();
LD:=LastValue(D);
LM:=LastValue(M);
{_expression_ to check against
price}
MA:=Mov(C,50,E);
{Mark securities meeting test
conditions}
RunD:=ExtFml("GV.GetVar","RunD");
RunM:=ExtFml("GV.GetVar","RunM");
RunY:=ExtFml("GV.GetVar","RunY");
Date:=RunD=D AND RunM=M
AND RunY=Y;
LastValue(Date AND C>MA
AND V>0);
{Filter}
{Discard if date or colB not
matched}
RunD:=ExtFml("GV.GetVar","RunD");
RunM:=ExtFml("GV.GetVar","RunM");
RunY:=ExtFml("GV.GetVar","RunY");
D:=DayOfMonth();
M:=Month(); Y:=Year();
RunD=D AND RunM=M AND
RunY=Y AND colB;
Filter enabled Yes
Periodicity Daily
Records required 500