I have reviewed the API docs and I cannot get the Market Replay to supply any data. Any ideas on what is wrong with this code? I am building off of some of the Tutorial code to avoid re-inventing the wheel:
$connBtn.addEventListener(‘click’, async () => {
if(socket.ws && socket.ws.readyState === 1) return
await socket.connect(URLs.MD_URL, accessToken)
socket.ws.addEventListener('message', onStateChange)
socket.ws.addEventListener('message', onStateChange) //this.socket may be old. Get the real socket and replace listener
const requestBody = {
startTimestamp: new Date('2023-09-22T08:00:00').toJSON(),
speed: 100, //100%, range is from 0-400%
initialBalance: 50000 //account balance for replay session
}
//Market Replay uncomment below
socket.ws.send(`replay/initializeclock\n1\n\n${JSON.stringify(requestBody)}`)
})
No errors during compiling, but it never renders any output.