I'm developing a strategy where I neet to filter the universe of stocks, basing my filtering on certain criteria.

I've used this one as a template:

EMA CrossOver


I filter the securities on their returns, but I do it on the past 2 days adjusted close. For instance, now I fire a buy event every Friday before market close, but the returns are based on the close of Wednesday and Thursday. How can I calculate the returns, instead, basing them on the prices, let's say, of Thursday at 15:30 AND of Friday at 15:30? Can I program the CoarseSelectionFunction to run at a certain time of the day and not everyday at midnight as it seems to do now?


Or the only solution is storing the price in the OnData function with something like " if Time.hour==15.30 " ?