If I have the following code, how could I include in the condition that the EMA crossover happens within the previous 3 days if it’s part of a larger scan with more conditions? As it stands this code could give results that have just crossed over or those that crossed over 6 month previous and are still climbing.
In essence, sine EMA’s are lagging indicators I’d like to screen for crossovers that happened, say, within the last week or so.