Request Realtime Market Data

I’m new to Tradovate. I’ve been following the example-api-js tutorial in github to request realtime market data (example-api-js/tutorial/WebSockets/EX-08-Realtime-Market-Data at main · tradovate/example-api-js · GitHub). I can connect fine to the API but when I make a md/subscribequote or md/getchart request it does not render any quote or chart data. It just makes a https://demo.tradovateapi.com/v1/contract/find?name=MSFT request and noting else happens.
Market data subscription was bought for the current month as well as API access.
What am I doing wrong?

You most likely are connected but not catching any responses or events.

Your request to https://demo.tradovateapi.com/v1/contract/find?name=MSFT should return a JSON response that looks like this:

{
  "id": 2586692,
  "name": "MSFT",
  "contractMaturityId": 45734,
  "status": "DefinitionChecked",
  "providerTickSize": 0.01
}

Thanks for the response. Yes, I receive that JSON response.
But then I always receive this response in the data variable in the switch in the code below:

Using this code from the tutorial:

TradovateSocket.prototype.subscribe = async function({url, body, subscription}) {
    ...

    const realtimeId = response?.d?.realtimeId || response?.d?.subscriptionId
    if(body?.symbol && !body.symbol.startsWith('@')) {
        const contractRes = await tvGet('/contract/find', { name: body.symbol })
        contractId = contractRes?.id || null
        if(!contractId) {
            contractId = await tvGet('/contract/suggest', {name: body.symbol })[0].id
        }
    }

    ...

    return new Promise((res, rej) => {
        
        switch(url.toLowerCase()) {
            ...
            case 'md/subscribequote': {
                cancelUrl = 'md/unsubscribequote'
                cancelBody = { symbol: body.symbol }
                if(this.listeningURL !== MD_URL) rej('Cannot subscribe to Quote Data without using the Market Data URL.')
                removeListener = self.addListener(data => {
                    if(data.d.quotes) {
                        data.d.quotes.forEach(quote => quote.contractId === contractId ? subscription(quote) : noop())
                    } 
                })
                break
            }     
        }

        ...
    })
}

I’m not sure if Tradovate streams equity data. Try inputting a futures contract like ESU4.

Hey, as far as I know in order to access market data via API you need to become a CME sub-vendor which is a whopping 290$/Month
I hope I am wrong tho.

1 Like

Correct. I believe it is closer to $500/mo now.

Take a look at DataBento for less than $40/mo

1 Like

Unfortunately, DataBento does not solve this problem if you want ticks. I just purchased the $179/month plan and I went through all the trouble of implementing their custom protocol and binary data format, only to finally realize when the binary data was parsed that all it contained was an error that said I wasn’t allowed to use live MBO data. It turns out you need their $1000/month plan to get live ticks, and even when you have that, you still have to register with CME and pay license fees directly to CME.

You can get tick data from the /trades request. This is included with the DataBento plan and what I am using.

MBO data is adds another level of detail and you are correct that MBO data is not included in the standard plan.