How to code this condition First hourly bar (10. 00 am) has closed above previous day high or below previous day low

At 10 am that is when the hourly bar is formed I want to know scripts where the hourly bar has closed above previous day high or below previous day low.

Unfortunately this cannot be coded in tradescript since this involves multiple timeframe charts.

As per you condition it has to different timeframes hourly and daily , which is not possible in single chart to code, verify your condition and make changes