# API Replay doesn't seem to be initializing the clock

**URL:** <https://community.tradovate.com/t/api-replay-doesnt-seem-to-be-initializing-the-clock/7925>\
**Category:** API Developers\
**Created:** [September 23, 2023, 7:15pm UTC](https://community.tradovate.com/t/api-replay-doesnt-seem-to-be-initializing-the-clock/7925 "2023-09-23T19:15:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![onemanwolfpack](https://avatars.discourse-cdn.com/v4/letter/o/b487fb/32.png) [@onemanwolfpack](https://community.tradovate.com/u/onemanwolfpack)\
**Post date:** [September 23, 2023, 7:15pm UTC](https://community.tradovate.com/t/api-replay-doesnt-seem-to-be-initializing-the-clock/7925/1 "2023-09-23T19:15:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![onemanwolfpack](https://avatars.discourse-cdn.com/v4/letter/o/b487fb/32.png) [@onemanwolfpack](https://community.tradovate.com/u/onemanwolfpack)\
**Post date:** [September 24, 2023, 3:05pm UTC](https://community.tradovate.com/t/api-replay-doesnt-seem-to-be-initializing-the-clock/7925/2 "2023-09-24T15:05:54Z")

</div>

Same here, would love a response.
