Historical data giving wrong data

Duke2sky
When I ask for nifty 50 historical data on 06dec2021 it is also giving data with timestamp 0645 hrs. However if i increase the time delta to 24 hrs it is giving right info . iam posting screenshot also
  • SRIJAN
    SRIJAN edited December 2021
    Tell the from and to times you are passing.
  • Duke2sky
    to_date = datetime.now()
    from_date = to_date - timedelta(hours=15)
  • SRIJAN
    SRIJAN edited December 2021
    Idk what's the problem,wait for Rakesh Sir's or Sujith Sir's response.
  • SRIJAN
    And while searching for the answer to your question,i found a issue too. In the historical data doc's example, the curl shows that the data was requested from=2015-12-28+09:30:00&to=2016-01-01+10:30:00 and the data was requested at 2016-01-01+13:30:00. Then why does the response is from 2015-12-28+09:15:00 to 2016-01-01+13:30:00. Shouldn't it be from=2015-12-28+09:30:00&to=2016-01-01+10:30:00?? Please throw some light on this also Rakesh Sir and Sujith Sir.
  • rakeshr
    @Duke2sky
    When I ask for nifty 50 historical data on 06dec2021 it is also giving data with timestamp 0645 hrs
    Can you check, if you are setting/manipulating tzinfo(time zone) in pandas? As, python historical data, date field is timezone aware field.

    @SRIJAN
    Then why does the response is from 2015-12-28+09:15:00 to 2016-01-01+13:30:00. Shouldn't it be from=2015-12-28+09:30:00&to=2016-01-01+10:30:00??
    Yes, candle data should be from 2015-12-28T09:30:00+0530 to 2016-01-01T10:30:00+0530. We will update the response example. Thanks for pointing out :)
  • SRIJAN
    That's good. Thanks. o:)
  • Duke2sky
    @rakeshr
    I am not manipulating timezone in pandas. Today on 07 dec same issue is there where at 0945 hrs when I fetch historical data keeping time delta of 6 hours I am getting data of 0645 too. If I increase time delta to 20 hours , it is giving correct data from 0915 hrs.
Sign In or Register to comment.