Stale Market Data From WebSocket API

sagarverma1919
Hi team,

I can see that I'm receiving stale market data from webSocket API via JAVA client of KiteConnect with version 3.1.3. i.e. Once the connection is established I receiving the tick data, but the ohlc values are same for every event. I'm attaching few samples and the entire log file for the instrument 884737 in the thread. The similar behaviour is also seen for the rest of the instruments which I'm processing.

Please note I'm not doing any transformation at my end this is just a serialised tick data that I've received from the library

Sample tick data:
{"mode":"full","tradable":false,"instrumentToken":884737,"lastTradedPrice":295.9,"highPrice":301.9,"lowPrice":295.0,"openPrice":300.5,"closePrice":302.55,"change":-2.197983804329874,"lastTradedQuantity":50.0,"averageTradePrice":298.06,"volumeTradedToday":1.0047433E7,"totalBuyQuantity":2150386.0,"totalSellQuantity":2565000.0,"lastTradedTime":1627013806000,"oi":0.0,"tickTimestamp":1627013806000,"openInterestDayHigh":0.0,"openInterestDayLow":0.0,"marketDepth":{"buy":[{"quantity":1,"price":295.85,"orders":1},{"quantity":2884,"price":295.8,"orders":11},{"quantity":2470,"price":295.75,"orders":17},{"quantity":26855,"price":295.7,"orders":86},{"quantity":9421,"price":295.65,"orders":34}],"sell":[{"quantity":2758,"price":295.9,"orders":12},{"quantity":3788,"price":295.95,"orders":8},{"quantity":24329,"price":296.0,"orders":61},{"quantity":7850,"price":296.05,"orders":15},{"quantity":17435,"price":296.1,"orders":29}]}}

{"mode":"full","tradable":false,"instrumentToken":884737,"lastTradedPrice":295.85,"highPrice":301.9,"lowPrice":295.0,"openPrice":300.5,"closePrice":302.55,"change":-2.214509998347377,"lastTradedQuantity":1.0,"averageTradePrice":298.06,"volumeTradedToday":1.0047433E7,"totalBuyQuantity":2150386.0,"totalSellQuantity":2565000.0,"lastTradedTime":1627013806000,"oi":0.0,"tickTimestamp":1627013807000,"openInterestDayHigh":0.0,"openInterestDayLow":0.0,"marketDepth":{"buy":[{"quantity":1,"price":295.85,"orders":1},{"quantity":2884,"price":295.8,"orders":11},{"quantity":2470,"price":295.75,"orders":17},{"quantity":26855,"price":295.7,"orders":86},{"quantity":9421,"price":295.65,"orders":34}],"sell":[{"quantity":2758,"price":295.9,"orders":12},{"quantity":3788,"price":295.95,"orders":8},{"quantity":24329,"price":296.0,"orders":61},{"quantity":7850,"price":296.05,"orders":15},{"quantity":17435,"price":296.1,"orders":29}]}}

{"mode":"full","tradable":false,"instrumentToken":884737,"lastTradedPrice":295.85,"highPrice":301.9,"lowPrice":295.0,"openPrice":300.5,"closePrice":302.55,"change":-2.214509998347377,"lastTradedQuantity":15.0,"averageTradePrice":298.06,"volumeTradedToday":1.0048251E7,"totalBuyQuantity":2152905.0,"totalSellQuantity":2566847.0,"lastTradedTime":1627013807000,"oi":0.0,"tickTimestamp":1627013808000,"openInterestDayHigh":0.0,"openInterestDayLow":0.0,"marketDepth":{"buy":[{"quantity":47,"price":295.85,"orders":1},{"quantity":1777,"price":295.8,"orders":11},{"quantity":2329,"price":295.75,"orders":17},{"quantity":27029,"price":295.7,"orders":88},{"quantity":9421,"price":295.65,"orders":34}],"sell":[{"quantity":2779,"price":295.9,"orders":15},{"quantity":3833,"price":295.95,"orders":9},{"quantity":24379,"price":296.0,"orders":62},{"quantity":8989,"price":296.05,"orders":20},{"quantity":17473,"price":296.1,"orders":30}]}}
  • sagarverma1919
    ++ @sujith for looking into it
  • sujith
    If you subscribe to full mode data then you will receive tick data when there is a change in any one of the fields, you are subscribed to.
  • sagarverma1919
    The OLHC value hasn't changed in the stream API, I've attached the entire days logs please check. Also I can see in the Zerodha platform that the OHLC value has been changing for the instrument 884737
  • sagarverma1919
    @sujith if needed we can get on call to rectify this, my entire system has been affected by this issue
  • sujith
    Websocket API gives you OHLC of the day, it doesn't change unless there is a new high or new low.
  • sagarverma1919
    Yes @sujith that's what I'm mentioning in Zerodha portal for the 884737 instrument I can see the OHLC value changing, but Websocket API is giving the same value throughout the day.
  • rakeshr
    We just checked for the same instrument 884737(TATAMOTORS-NSE) OHLC kite web and websocket stream is matching fine.
    [{'tradable': True, 'mode': 'full', 'instrument_token': 884737,
    'last_price': 292.3, ..., 'ohlc': {'open': 295.0, 'high': 295.5, 'low': 291.0, 'close': 295.55}

    Can you paste the WebSocket stream API response along with the kite web screenshot? Make sure, you are matching the correct field.
  • sagarverma1919
    Below is the WebSocket stream response for the mentioned instrument at 09:50:07 AM Friday

    {"mode":"full","tradable":false,"instrumentToken":884737,"lastTradedPrice":296.3,"highPrice":301.9,"lowPrice":295.0,"openPrice":300.5,"closePrice":302.55,"change":-2.0657742521897204,"lastTradedQuantity":9.0,"averageTradePrice":298.01,"volumeTradedToday":10344168,"totalBuyQuantity":2320351.0,"totalSellQuantity":2597628.0,"lastTradedTime":1627014007000,"oi":0.0,"tickTimestamp":1627014007000,"openInterestDayHigh":0.0,"openInterestDayLow":0.0,"marketDepth":{"buy":[{"quantity":17,"price":296.25,"orders":4},{"quantity":286,"price":296.2,"orders":6},{"quantity":7276,"price":296.15,"orders":17},{"quantity":10222,"price":296.1,"orders":21},{"quantity":7263,"price":296.05,"orders":28}],"sell":[{"quantity":1371,"price":296.3,"orders":10},{"quantity":5777,"price":296.35,"orders":16},{"quantity":16313,"price":296.4,"orders":37},{"quantity":12215,"price":296.45,"orders":32},{"quantity":41229,"price":296.5,"orders":93}]}}

    And in Kite web for the time 9:50AM Friday the values are below:

    high = 296.60
    low = 296.15
    open = 296.15
    close = 296.45




    Also @rakeshr the value of OHLC are same for the entire stream data, i.e.
    "highPrice": 301.9,
    "lowPrice": 295.0,
    "openPrice": 300.5,
    "closePrice": 302.55

    and this behaviour is seen for every instrument data that I'm processing

    You can also check this in the entire day stream logs which I've shared in my first post "Zerodha Tick Data.log.zip"
  • sujith
    You are comparing TATAMOTORS, NSE with TATAMOTORS, BSE.
  • sagarverma1919
    sagarverma1919 edited July 2021
    My bad, below is the updated values from Kite Web platform at 9:50AM Friday


    high = 296.51
    low = 296.17
    open = 296.26
    close = 296.51
  • sagarverma1919
    @sujith & @rakeshr This is a P0 issue for me, can we escalate this? or if there is any other procedure to raise an issue please let me know

    If your team is already looking into it can you please share the ticket number or a tracking link where I can see the progress. This is causing financial impact at our end
  • sujith
    There is no issue here. Charts are showing the hour candles and the Websocket data has day OHLC value.
  • sagarverma1919
    @sujith why I'm getting the entire day data from Websocket, shouldn't I be getting the updated OHLC values from streams as well? Only the OHLC is constant, in other fields I can see the values are changing
  • sujith
    You can go through the documentation.
    We don't manufacture data, we just relay whatever exchange publishes.
    You can make candles at your end using the live market data provided on Websockets API. You can get started here.
  • sagarverma1919
    sagarverma1919 edited July 2021
    @sujith I've already build the capability to create the candles from webSocket API at my end, but for that I've to get the updated OHLC price values, right?

    Please refer to the data which I've shared in my first post, you'll see that I'm getting the same "highPrice", "lowPrice", "openPrice", "closePrice" values for the entire day
  • sagarverma1919
    @sujith Do we have any SLA or any official medium where I can raise a ticket?
  • sujith
    Kite Connect doesn't have support. We just help out the community developers here. We are all developers like you. There are no support executives.

    You can read the previous reply properly and you will get your answer.
Sign In or Register to comment.