first minute candle High and Low mismatch between Kiteconnect api and kite.zerodha

jogendra
Hi,


I am seeing a mismatch in 1st 1minute candle formed by collecting WebSocket ticks and Zerodha charts. My application is processing all the ticks received without missing any. Please advise on why such a difference exists between the api and kite charts.


instrument: NIFTY MARCH FUT
As per API -> 2022-03-09T09:15:00 Open:16039 High:16039 Low:15981.5 Close:16024.15
As per zerodha charts-> 2022-03-09T09:15:00 Open:16065 High:16065 Low:15981.5 Close:16020.0

Thanks in advance
Jogendra



  • SRIJAN
    SRIJAN edited March 2022
    You may have missed a few ticks.
    https://tradingqna.com/t/why-does-two-charts-of-the-same-timeframe-look-different-on-the-same-platform/4715 . The websocket data which you get is the same data used on all platforms by Zerodha.
  • jogendra
    Hi,
    Today's update:

    instrument: NIFTY MARCH FUT
    As per API -> 2022-03-11T09:15:00 Open:16533 High:16533 Low:16478.9 Close:16504.5
    As per zerodha charts-> 2022-03-11T09:15:00 Open:16533 High:16543.95 Low:16478.25 Close:16504.5


    However for NIFTY50 spot, there is a perfect match on O,H,L,C data for all 1-minute candles,

    instrument: NIFTY 50
    As per API -> 2022-03-11T09:15:00 Open:16528.8 High:16532.7 Low:16472.55 Close:16479.35
    As per zerodha charts-> 2022-03-11T09:15:00 Open:16528.8 High:16532.7 Low:16472.55 Close:16479.35

    I am running my app on a web server. Assuming that I have missed a few ticks because of which there is a mismatch in NIFTY Futures candles, How I am getting the exact match for NIFTY50 spot candles?



  • SRIJAN
    SRIJAN edited March 2022
    It's just a coincidence. It's not necessary that spot and future will make high/low at same time. You might have catched the ticks when spot made high/low but missed some when future made high/low. Why don't you just read the thread I shared? It's perfectly normal that a slight mismatch happens between 2 different platforms. But, Zerodha data will be always more accurate. As you can see, Zerodha's data range is always wider than yours.
  • jogendra
    Hi SRIJAN,

    Thanks for the reply,

    I have gone through the thread and I understand that it is possible to miss some ticks due to network connectivity issues, especially when we are using a browser with a home network. This is unlikely to happen when using a web server with a good network connection.

    I am attaching the 1minute candle data formed using the WebSocket, for both NIFTY50 spot and NIFTY MAR FUTURES, for the day 11-03-2022.

    There are about 375 candles for the day and for the NIFTY spot, there is a perfect match with Zerodha charts for all the candles. However, for the NIFTY future, there is a near 95% mismatch in all candles. I think this can not be a coincidence.

    I truly appreciate your help if you can just look into the code attached and figure out if I am doing anything wrong in forming the candles.

    I am using Redis DB Queue and pushing the ticks as and when I am receiving (lpush) them and using a different worker thread, processing the ticks by poping (rpop) from the queue.

    Regards
    Jogendra
Sign In or Register to comment.