Not getting tick data after "Error parsing instrument tokens."

narayanan
narayanan edited July 2018 in .Net API client
Hello,
Last two weeks I am getting this Error from ticker "Error parsing instrument tokens." Not getting tick data after that.
Please find the below log data. I am using .Net Client Kite Connect.

DEBUG: 200 {"status":"success","data":{"user_type":"investor","email":"[email protected]","user_name":"TamiSi","user_shortname":"T","broker":"ZERODHA","exchanges":["BSE","NSE","BFO","NFO","MCX","CDS"],"products":["BO","CNC","CO","MIS","NRML"],"order_types":["LIMIT","MARKET","SL","SL-M"],"avatar_url":null,"user_id":"DT0429","api_key":"Changed","access_token":"XXXXXXXXX","public_token":"XXXXXXXXXXX","refresh_token":"","login_time":"2018-07-15 21:59:20"}}

{"APIKey":"XXXXXXXXX","Products":["BO","CNC","CO","MIS","NRML"],"UserName":"Tami Sivaraman","UserShortName":"T","AvatarURL":null,"Broker":"ZERODHA","AccessToken":"XXXXXXXXXXXX","PublicToken":"XXXXXXX","RefreshToken":"","UserType":"investor","UserId":"XXXXXXX","LoginTime":"7/15/2018 9:59:20 PM","Exchanges":["BSE","NSE","BFO","NFO","MCX","CDS"],"OrderTypes":["LIMIT","MARKET","SL","SL-M"],"Email":"[email protected]"}
4
7/15/2018 9:59:32 PM Heartbeat
4
3
7/15/2018 9:59:36 PM Heartbeat
32
32
32
32
{"a":"mode","v":["quote", [11717378]]}
{"a":"mode","v":["quote", [11719682]]}
32
{"a":"mode","v":["quote", [11720194]]}
32
{"a":"mode","v":["quote", [11720450]]}
{"a":"mode","v":["quote", [11717122]]}
{"a":"mode","v":["quote", [11718146]]}
4
3
2
1
0
Resubscribing
{"a":"unsubscribe","v":[11717378,11719682,11720194,11720450,11717122,11718146]}
77
{"a":"mode","v":["ltp", []]}
{"a":"mode","v":["quote", [11717378,11719682,11720194,11720450,11717122,11718146]]}
{"a":"mode","v":["full", []]}
New interval 5
5
WebSocket Message: {"type":"error","data":"Error parsing instrument tokens."}
WebSocket Message: {"type":"error","data":"Error parsing instrument tokens."}
4
7/15/2018 9:59:44 PM Heartbeat
4
3
2
7/15/2018 9:59:47 PM Heartbeat
  • rakeshr
    @narayanan
    You need to pass instrument tokens as numbers,not as string.
  • narayanan
    Hi Rakesh,
    I am subscribing with numbers only. You can see UInt32.
    _ticker.Subscribe(Tokens: new UInt32[] { _stockInput.InstrToken });
    _ticker.SetMode(Tokens: new UInt32[] { _stockInput.InstrToken }, Mode: Constants.MODE_QUOTE);

    I suspect the check need to be handled from your side on Full and ltp being empty.
  • narayanan
    I just cross verified with subscribing all mode Mode: Constants.
    The issue is not occurring. When ticker disconnected resubscribing happens automatically as said in the above log. Since i have not used Full and LTP and it is being empty. We are getting Error Parsing Instrument Tokens.

    Please add the check for empty string on your end and handle gracefully to avoid ticker disconnection.

    After below Work around from my end No issue occurs.
    _ticker.Subscribe(Tokens: new UInt32[] { 11717378 });
    _ticker.SetMode(Tokens: new UInt32[] { 11717378 }, Mode: Constants.MODE_LTP);
    _ticker.Subscribe(Tokens: new UInt32[] { 11719682 });
    _ticker.SetMode(Tokens: new UInt32[] { 11719682 }, Mode: Constants.MODE_FULL);
    _ticker.Subscribe(Tokens: new UInt32[] { _stockInput.InstrToken });
    _ticker.SetMode(Tokens: new UInt32[] { _stockInput.InstrToken }, Mode: Constants.MODE_QUOTE);

    7/17/2018 8:45:03 AM , Reconnecting

    7/17/2018 8:45:04 AM , Connected ticker
  • rakeshr
    @narayanan
    We are checking on this.
Sign In or Register to comment.