Hi all, once i finish work at 6 in the weekday i want to see what the market has done in the previous say 3 hours and if the conditions are met between 3-6pm the screener to show these stocks, is there a line of code to define previous x amount of hours?
You can scan conditions backwards using bars as rerefence, 1 bar, 2 bars, up to 254 bars (1024 on PRT direct).
On a 30-minute chart, 3 hours is 6 bars, so you can use summation[6] to check if any condition was met in that time range:
Cond1 = ...
Cond2 = ...
Cond3 = ...
Cond = Cond1 AND Cond2 AND Cond3
SCREENER[summation[6](Cond)]