This started to happen 3-4 days ago. I have my algo coded to square off all the positions by 15:28 and log the last remaining actions. However, for some reason the algo does not call on_ticks function post 15:28. This is a new issue. I have tried ending my algo at other times, like 12:15, or nearr 11 am, and it has worked as commanded. But for some reason, it does not work post 15:28.
Now I know on_ticks is not getting called because I have the function print "called on_ticks at {time}" and it works all the way from 9:15 to 15:27:57. Please help me figure out whats wrong.
This is the basic structure of my on_ticks function:
def on_ticks(ws, ticks): print("called on_ticks at {time}") if time >= 9:15 and time < 15:28: deploy strategy elif time > 15:28 print("squaring off") ws.close() log(stuff)
Here, the "squaring off" is not printed on the console and nothing is logged post 15:27:57. Please help!