Price in API different from Price on Zerodha chart & Streak

avinashcherukuri
Team - The opening 1 hour range price for 12th September as per API was High - 26998.65 & Low - 26743.4 while the price in kite.Zerodha chart was HIgh 26980.05 & Low 26746.45. Streak and Kite.Zerodha are in line while your API data is not in line due to which my trade execution was different from that on the chart. Appreciate if you could investigate and let me know which one is correct and how can the loss on my trade be made good?
  • rakeshr
    @avinashcherukuri
    Let us know which contract/scrip, you were checking? Where you using Historical data APIs for fetch 1 hour candle data?
  • avinashcherukuri
    This is on Bank Nifty Sept 27th Futures

    Below is the extract of the feed I received. My server is based on West coast timings in the US, but this was the first few ticks received. As you can see 20:45:2 is the time which corresponds to 9:15:02 India time. I've also enclosed the image of kite chart.


    [{'timestamp': datetime.datetime(2018, 9, 11, 20, 45, 2), 'last_price': 26952.0, 'oi_day_low': 1798200, 'volume': 1520, 'sell_quantity': 53480, 'last_quantity': 40, 'change': 0.00519468954309535, 'oi': 1798200, 'average_price': 26967.6, 'ohlc': {'high': 26998.65, 'close': 26950.6, 'open': 26980.05, 'low': 26952.0}, 'tradable': True, 'depth': {'sell': [{'price': 26954.95, 'orders': 1, 'quantity': 80}, {'price': 26955.35, 'orders': 1, 'quantity': 40}, {'price': 26964.7, 'orders': 2, 'quantity': 120}, {'price': 26967.25, 'orders': 2, 'quantity': 120}, {'price': 26967.3, 'orders': 1, 'quantity': 80}], 'buy': [{'price': 26951.1, 'orders': 1, 'quantity': 80}, {'price': 26951.0, 'orders': 2, 'quantity': 80}, {'price': 26950.25, 'orders': 1, 'quantity': 40}, {'price': 26950.0, 'orders': 1, 'quantity': 40}, {'price': 26944.5, 'orders': 1, 'quantity': 80}]}, 'mode': 'full', 'last_trade_time': datetime.datetime(2018, 9, 11, 20, 45, 2), 'buy_quantity': 36520, 'oi_day_high': 1798200, 'instrument_token': 10991618}
  • avinashcherukuri
    I was not using historical API. This is live data.
  • rakeshr
    @avinashcherukuri
    Kite Chart uses Historical APIs to plot candles, while market depth data is feed through Streaming WebSocket.Both of these data can be different, you can have look to this thread.
  • avinashcherukuri
    Even if we go with the argument that the tick data just picks up the last 2-3 trades, how can we have the fundamental data being different. If there is a high in the API, should that high not be reflected in the candle? How can the Kite chart be considered reliable with such differences?
  • nithin
    @avinashcherukuri maybe check this answer of mine. Every second there could be hundreds of ticks on the exchange. Through a leased line we get a maximum of 3 ticks. So it is impossible for any platform to capture all ticks on a chart or marketwatch. The only way is by consuming tick by tick data feed, explained in the link above.
    Currently the leased lines which stream data to marketwatch and to historical charts servers are different. So the 3 random ticks which each of these send could be different. Usually no one spots it, unless there are some stray ticks which wasn't streamed on one of the lines.
    Kite charting is going through a huge overhaul, what we intend to do is stream data to chart and then to the marketwatch. This way, both match. But I guess you'd understand by now, that this will be just a cosmetic change to avoid similar question in the future. Technically it is impossible to show all ticks that happen on the exchange on a platform chart.
Sign In or Register to comment.