# Cannot susbscribe to market data

**URL:** <https://community.tradovate.com/t/cannot-susbscribe-to-market-data/10311>\
**Category:** Community Support\
**Created:** [September 29, 2024, 5:21pm UTC](https://community.tradovate.com/t/cannot-susbscribe-to-market-data/10311 "2024-09-29T17:21:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dylan\_Clark](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Dylan\_Clark](https://community.tradovate.com/u/Dylan_Clark)\
**Post date:** [September 29, 2024, 5:21pm UTC](https://community.tradovate.com/t/cannot-susbscribe-to-market-data/10311/1 "2024-09-29T17:21:30Z")

</div>

Hi,

I have a websocket client that I use for all my exchange market data. It is a c++ client based on websocketscpp.

#[live.tradovateapi.com](http://live.tradovateapi.com) for Live only functionality.  
#[demo.tradovateapi.com](http://demo.tradovateapi.com) for simulation engine.  
#[md.tradovateapi.com](http://md.tradovateapi.com) and for a market data feed.

are available. I am only paper trading (in DEV) so Im connecting to [demo.tradovateapi.com](http://demo.tradovateapi.com)

• I can successfully issue my request for token using username, secret , cid etc. This is done via a CURL using a C++ request and the response gives me an accessToken, marketAccessToke as well as these other JSON fields

,“hasLive”:false,“outdatedTaC”:false,“hasFunded”:false,“hasMarketData”:true,“outdatedSentimentPolicy”:true}

• Then I can successfully establish a connection to wss://demo.tradovateapi.com/v1/websocket

$ ./client wss://demo.tradovateapi.com/v1/websocket/md/subscribeQuote  
Successfully connected to:  
wss://demo.tradovateapi.com/v1/websocket/md/subscribeQuote  
Running websocket: wss://demo.tradovateapi.com/v1/websocket/md/subscribeQuote  
[2024-09-29 19:17:09] [connect] Successful connection  
[2024-09-29 19:17:09] [connect] WebSocket Connection 34.117.68.229:443 v-2 “WebSocket++/0.8.2” /v1/websocket/md/subscribeQuote 101

Note: I do not use the accessToken or mdAccessToken to connect. I think this is the source of error but I’m not sure.

However I know the wss connection is ok because I get a response back;

Connection is opened ok as my CURL callback receives o” . Note after this I get nothing back, no heartbeats, no “server disconnecting session” etc. (i.e. I get no ‘h’, ‘a’ or ‘c’ messages back from tradovate)

• I then try to subscribe to GOOG with websockets (websocketscpp). I send the follow over the websocket connection opened above (same client process that obtained the tokens)

{“id”:“0231242342232”,“method”:“subscribe”,“symbol”:“GOOG”}

I also try with just symbol and id (always uuid)  
{“id”:“45646546”, symbol”:“GOOG”}  
However I cannot subscribe! Nothing is coming back I know today is Sunday and market is closed but this is consistently failing. Can you see the fault?

./client wss://md.tradovateapi.com/v1/websocket/md/subscribeQuote  
g++ -I. -I/home/gjw/websocketpp -std=c++2a -o client websockets.cpp main.cpp -lssl -lcrypto -lcurl -ljsoncpp -lpthread -lwebsockets  
gjw@LUNA056:~/tradovate\_abundance/GRAHAMS$ ./client wss://demo.tradovateapi.com/v1/websocket/md/SubscribeQuote  
Received: {“accessToken”:“XXXXXXXXXXXXXXXXXXXXXXXXX”,“mdAccessToken”:“YYYYYYYYYYYYYYY”,“expirationTime”:“2024-09-29T18:31:05.785Z”,“userStatus”:“Active”,“userId”:2854187,“name”:“Google:102927092604715150178”,“hasLive”:false,“outdatedTaC”:false,“hasFunded”:false,“hasMarketData”:true,“outdatedSentimentPolicy”:true}  
Running websocket: wss://demo.tradovateapi.com/v1/websocket/md/subscribeQuote  
[2024-09-29 19:17:09] [connect] Successful connection  
[2024-09-29 19:17:09] [connect] WebSocket Connection 34.117.68.229:443 v-2 “WebSocket++/0.8.2” /v1/websocket/md/subscribeQuote 101  
Received: o  
--------------------------\> GREAT - got control character ‘o’ back from tradovate

Sending following subscription symbol message: {“id”:“023991242342232”,“symbol”:“GOOG”}  
Sent OK!  
[2024-09-29 19:17:12] [frame\_header] Dispatching write containing 1 message(s) containing 6 header bytes and 40 payload bytes  
[2024-09-29 19:17:12] [frame\_header] Header Bytes:  
[0] (6) 81 A8 29 2D BC B2

[2024-09-29 19:17:12] [frame\_payload] Payload Bytes:  
[0] (40) [1] R  
¬ ¬  
^KBА fj

[2024-09-29 19:17:13] [control] Control frame received with opcode 8  
[2024-09-29 19:17:13] [frame\_header] Dispatching write containing 1 message(s) containing 6 header bytes and 5 payload bytes  
[2024-09-29 19:17:13] [frame\_header] Header Bytes:  
[0] (6) 88 85 63 61 15 65

[2024-09-29 19:17:13] [frame\_payload] Payload Bytes:  
[0] (5) [8] 60 89 57 1C 06

[2024-09-29 19:17:13] [info] asio async\_read\_at\_least error: asio.ssl.stream:1 (stream truncated)  
[2024-09-29 19:17:13] [error] handle\_read\_frame error: websocketpp.transport:2 (Underlying Transport Error)  
[2024-09-29 19:17:13] [info] asio async\_write error: asio.ssl:337690831 (protocol is shutdown)  
[2024-09-29 19:17:13] [fatal] handle\_write\_frame error: websocketpp.transport:2 (Underlying Transport Error)  
^C

---

<div class="post-metadata">

**Author:** ![Johann\_Birle](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/johann_birle/32/3032_2.png) [@Johann\_Birle](https://community.tradovate.com/u/Johann_Birle)\
**Post date:** [September 30, 2024, 4:39pm UTC](https://community.tradovate.com/t/cannot-susbscribe-to-market-data/10311/2 "2024-09-30T16:39:18Z")

</div>

If you’re trading on Tradovate or Rithmic, automation can save you time—check out pickmytrade.trade for Tradovate and [pickmytrade.io](http://pickmytrade.io) for Rithmic.

---

<div class="post-metadata">

**Author:** ![Amrita\_Chandarana](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Amrita\_Chandarana](https://community.tradovate.com/u/Amrita_Chandarana)\
**Post date:** [September 1, 2025, 2:25pm UTC](https://community.tradovate.com/t/cannot-susbscribe-to-market-data/10311/3 "2025-09-01T14:25:20Z")

</div>

tried but not like that interface
