Hi All,
I am building a Futures back tester to verify my strategies in Python. I am having problems with getting wss updates after initializeclock request for the second time. After the second initializeclock request, I see the replay Tradovate browser session properly reset to the correct time and replay speed, but I don’t see any wss streaming messages from Tradovate wss socket after the reset. There are no heartbeat(‘h’) messages, close(‘c’) messages or any other messages.
I basically have the following (pseudo code):
while True:
if open message:
authorize user
send initializeClock for first time period start time
if ‘a’ message:
if clock timestamp > first time period end time:
send initializeClock for second time period start time
Here is my wss call:
body = {
‘startTimestamp’: self.replay_time,
‘speed’: 200,
‘initialBalance’: self.startingAcctBalance
}
await self.websocket.send(f"replay/initializeclock\n{self.next_request_id()}\n\n{json.dumps(body)}")
On the second call, I change the speed and startTimestamp, and the gui replay session switches to the correct time and speed. No wss updates after the 2nd initializeclock request.
I believe I can use the same wss connection, and rerun the scenarios by sending an initializeClock for every scenario, there is no need to tear down any sockets and restart the program.
Is there a problem with sending streaming updates after the 2nd initializeClock message request?
Am I missing anything with respect to using the wss correctly.
BTW, great API every easy to understand.
Great Work!
Thanks,
H