kite.historical_data for 60 minutes OHLC is not same as kite web app.

rvarade
rvarade edited May 2020 in Python client
I have used kite.historical_data for getting 60minute OHLC data for TATASTEEL20MAYFUT
When i give start_date and end_date as 2020-05-12 09:15:00+05:30
I get.....
date open high low close volume
0 2020-05-12 09:15:00+05:30 273.1 273.1 269.75 270.75 390000

this data does not match with kite web app hourly candle. On web app "Close is 265.65". Nearly 5 RS differene is not at all acceptable.
Please check and let me know how i do i get more accurate data.
Tagged:
  • sujith
    This is the response we got.
    [
    "2020-05-12T09:15:00+0530",
    273.1,
    273.1,
    262.6,
    265.65,
    8253000
    ],
    It seems fine. At what time did you try to fetch?
  • rvarade
    @sujith Thanks for you response.
    when i try , from and to date as same,,,,,i get wrong data.
    kite.historical_data(13466626, '2020-05-12 09:15:00+05:30','2020-05-12 09:15:00+05:30','60minute', 0)

    when i change "to_date" to as in below call, i get correct data for 9:15 candle.
    kite.historical_data(13466626, '2020-05-12 09:15:00+05:30','2020-05-12 10:15:00+05:30','60minute', 0)

    Is there any way i can get accurate data for single hour? if i give from_date:9:15 to_date 10:15, i get two candles.

    thanks,
  • rakeshr
    @rvarade
    Is there any way i can get accurate data for single hour? if i give from_date:9:15 to_date 10:15, i get two candles.
    You need to sent to_date as exact end period of that particular period candle(here hour candle) i.e 10:14:59.
    Eg.
    kite.historical_data(instrument_token='13466626',
    from_date='2020-05-12 09:15:00', to_date='2020-05-12 10:14:59',
    interval="60minute")
  • rvarade
    @rakeshr you are absolutely right.... Thanks for your help ! Work perfectly well !
This discussion has been closed.