There are a lot more very helpful articles and videos here …
https://www.prorealcode.com/blog-list-view/
The next iteration would be to add some parameters around the trade e.g.
IF the first 30 minutes (08:00 – 08:10) of market trading was in positive territory;
BUY the last 10 minutes of trading (16:20 – 16:30)
OR do the reverse if the reverse is true.
Have a go at it yourself, you won’t break PRT 🙂 and it’s the only way to learn.
Post your code as you go along (if not working) and I’m sure members of this Community will help at each hurdle you are trying to cross.