I am trying to code a simple 5 miute open range break strategy. The strategy takes only the long side of a trade if the opening 5 minute range is broken anytime before 12pm on the trading day. Positions are exited 15 minutes before the close. However, the first day of trading the algo seems to do what is expected but after that the 5 miute range isn't being observed by the algorithm for each day to have its on trading occur. Can someone help me to understand where I am going wrong in my code logic or implementation? Thank you

236376_1708099825.jpg