How to configure getChart for Range? [Resolved]

I pulled down the WebSockets example from GitHub and have been playing with EX-10a-Chart-Data-Solution. In the Tradovate application i use a time period of Range 17

unsubscribe = await socket.subscribe({
            url: 'md/getchart',
            body: { 
                symbol: 'NQZ1',
                chartDescription: {
                    underlyingType: 'Custom',
                    elementSize: 17,
                    elementSizeUnit: 'Range',
                    withHistogram: false,
                },
                timeRange: {
                    asMuchAsElements: 1000
                }
            },

The code above is what I tried but Iā€™m getting a promise not returned error. What is the correct way to subscribe to getChart with Range?

1 Like

I got it sorted. The underlyingType is Tick. elementSize is the range length and the elementSizeUnit is Range.

the working solution is

unsubscribe = await socket.subscribe({
            url: 'md/getchart',
            body: { 
                symbol: 'NQZ1',
                chartDescription: {
                    underlyingType: 'Tick',
                    elementSize: 17,
                    elementSizeUnit: 'Range',
                    withHistogram: false,
                },
                timeRange: {
                    asMuchAsElements: 1000
                }
            },
2 Likes