historical data timestamp error

rajtk
rajtk edited December 2017 in General
I wanted to fetch 5 mins 2 months old data. Not sure why it has to start with 3:45 pm onwards. Can't we get this historical data as we get from pi and save it to excel.
Please make it easier.
report = kite.historical(instrument_token=token,from_date="2017-10-30", to_date= "2017-11-30",interval= "5minute")
df = pd.DataFrame(report)
df['date'] = pd.to_datetime(df['date']) #pd.to_datetime(df['date'], format = '%Y-%m-%d:%H:%M:%S')#
df['T_time'] = pd.to_datetime(df['date']).dt.time
data = df.set_index(['date'])
print data.head(10)
EXIDEIND
close high low open volume T_time
date
2017-10-30 03:45:00 204.65 204.95 203.70 203.90 3193 03:45:00
2017-10-30 03:50:00 204.50 204.90 204.25 204.65 3480 03:50:00
2017-10-30 03:55:00 205.30 205.45 204.50 204.50 1118 03:55:00
2017-10-30 04:00:00 205.05 205.30 204.70 205.30 1161 04:00:00
2017-10-30 04:05:00 205.20 205.30 205.05 205.05 3068 04:05:00
2017-10-30 04:10:00 204.80 205.50 204.80 205.20 2253 04:10:00
2017-10-30 04:15:00 204.90 205.10 204.60 204.80 3439 04:15:00
2017-10-30 04:20:00 204.75 205.00 204.75 204.90 3974 04:20:00
2017-10-30 04:25:00 204.70 205.00 204.65 204.75 1448 04:25:00
2017-10-30 04:30:00 205.00 205.00 204.70 204.70 152 04:30:00
Tagged:
  • sujith
    Hi,
    Can you give us instrument token for which you are getting data from 15:45?
  • rajtk
    the above one is for PNB. I guess am are getting this for all the scripts. I ran this yesterday around 7:00 pm
  • sujith
    Hi,
    We follow 24-hour format. I just checked for PNB on 30/10/2017, it seems fine.
  • rajtk
    I will try doing this (datetime.datetime.strptime("2015-12-28T09:15:00+0530", "%Y-%m-%dT%H:%M:%S+0530") ,
    maybe it will help.
  • rajtk
    Please close this ticket
This discussion has been closed.