I have this simple program that buys APPL using a Stop buy order at the high of the previous day each day when the market opens. One minute before the market closes, it is canceled if the buy order hasn't been filled. Both of those parts are working, as when I look at the buy order logs, I notice that the program does put the buy order at the right price and cancels at the right time. My main issue is that none of the Stop Market orders are getting filled even when the price breaches the stop price. For example, on 1/13/21, the program placed a buy order for AAPL at a Stop price of 129.74, which is correct. The high for 1/13/21 was 131.45, meaning the order should have been filled. However, the program canceled the order one minute before the market closed. Another example was on 4/7/21 when the program placed the stop buy demand for AAPL at 127.17, and the high of that day was 127.92, so the order should have been filled, but it ended up being canceled as well. Could someone please help me resolve this issue?