Hi @Alexander
I have been able to use my strategy to create and execute trades in both replay + demo. Great api once I wrapped my little brain around it.
One thing that I did notice was when I was replaying a chunk of data, my connection seemed to stop receiving data or messages. I am using Python’s Websockets library and do handle for closed connections etc (but don’t seem to even see an exception or the ‘c’ data frame occurring).
On further debug, it seems to happen after a certain amount of time. Examples:
-
Say I initialize a replay for
"startTimestamp": "2022-07-28T07:00:00.000-04:00", "speed": 400, "initialBalance": 50000
, it works fine until2022-07-38T11:00:05.933-04:00
or roughly 4 hours replay time. -
Say I initialize a replay for
2022-07-38T11:00:05.933-04:00
, it seems to fail a little after 3 PM or in ~4 hours of replay time.
At 400% speed, this coincides with roughly 1 hour of real time.
A few questions:
- Can you run replay events indefinitely?
- I came across another post API Order Failures - #21 by Arthur where it discusses renewing the access token. I am currently not renewing the web socket’s access token (my rationale is I make only web socket requests). Do we think this is the culprit?
- For renewing the accessToken, I get we pass the existing accessToken to
/auth/renewAccessToken
. If I automatically make that request, will the web socket on the server’s side handle that and be updated (as I don’t send the access token with each request). - Replay shares MD_Client + Trade_Client socket connections. If I call “renewAccessToken” in MD_Client, won’t I have issues of then calling Trade_Client’s renewal? Or can I freely call it with whichever accessToken was originally used to create the web socket connection?
Sorry I was stumped since no socket errors or socket disconnects appeared but I think this might be the culprit.
Thanks!