Historical Data of instruments and indices not matching when frequency is 1day

I have subscribed to kite historical data api, and using it to get 1day interval data is not matching with kite web platform.
Let me know what you need me to let you know as parameters, and debug logs if any.
  • neerajgoyal12
    OHLC is not matching.
  • sujith
    Can you share for which scrip and for what date are you checking? You can share the complete stack trace so that we can take a look at the issue.
  • neerajgoyal12
    ''' #Code
    print(f'instrument_token: {instrument_token}')
    print(f'date_from {date_from}', f'date_to {date_to}')
    data_array = kite.historical_data(instrument_token, date_from, date_to, "day", False, False)
    df = pd.DataFrame(data_array)
    print("\n" + df.tail(10).to_markdown())
    Output Below

    Let me know if you need anything else. Tried with date_to with time 18:00:00 as well and same output as above.
  • neerajgoyal12
    These are the instruments
    ''' ['NIFTY 50', 'ADANIPORTS', 'AUBANK'] '''
  • rakeshr
    You seem to be sending to time as 16:00 for each day it should either be the day start time 09:00:00 or 00:00:00. This thread explains more.
  • neerajgoyal12
    can you try this at your end and send me to date and from date values ?
  • rakeshr
    I just checked for
    "GET /instruments/historical/256265/day?from=2023-05-15 00:00:00&to=2023-05-19 00:00:00&interval=day&continuous=0&oi=1
    {'date': datetime.datetime(2023, 5, 19, 0, 0, tzinfo=tzoffset(None, 19800)),
    'open': 18186.15, 'high': 18218.1, 'low': 18060.4, 'close': 18203.4, 'volume': 0, 'oi': 0}

    And it's showing correct value.
  • neerajgoyal12
    Hi is this close prices correct for following instruments
    | date | NIFTY 50 | ADANIPORTS | AUBANK |
    | 2023-05-30 00:00:00+05:30| 18633.85 | 734.05 | 776.15. |

    as the portal is showing following attached chart for NIFTY 50

    Similarly ADANIPORTS or AUBANK does not match, using above code as previously pointed.
Sign In or Register to comment.