Hi,
I'd like to be able to have the option to cancel all open orders, and then place new ones in a single handle_data call. In other words, I do not want to cancel trades first, and then wait for handle_data to be called again due to a new tick coming through during live trading.
To do this, I would first want to check that the orders are properly cancelled, but to do that I have to wait a bit (say, 1 second) before this is possible.
when I apply a time.sleep(1) within handle_data, I get errors.. I imagine this is likely because the library do not know how to handle such cases?
If it does know how to handle it, would you please provide an example of how to introduce a time delay? How should we expect the back-testing behaviour to be in such cases of time delay introduction?
Many thanks,