I would like to write a code for a scanner that scans stocks with minimum 25% increase in EPS annually. However, no results when the interval was selected as Month. What's wrong with the code?
Code:
Def percentage = 0.25;
def AE = if IsNaN(GetActualEarnings()) then 0 else GetActualEarnings();
Def EPS_TTM = sum(AE, 12);
Def EPS2Years = sum (AE,24) - sum (AE,12);
Def EPS3Years = sum (AE,36) - sum (AE,24);
Def PrcntChng2 = (EPS_TTM/EPS2Years)-1;
Def PrcntChng3 = (EPS2Years/EPS3Years)-1;
Plot Signal= prcntChng2 >= percentage and
prcntChng3 >= percentage;