I yesterday subscribed Kite API and historical API . While testing my Python code historical data is not providing time in date of script, it is Sending as 00:00:00+5:30GMT format.
Please help out why time coming as 00:00:00 some times ?
Yes, for day candle interval time will come as 00:00:00+05:30 for hours and minutes stamp. Complete date field will be eg:2022-11-22 00:00:00+05:30 For minute candle intervals, you will get values for hours and minutes. eg:2022-11-22 09:15:00+05:30
wrong data coming during from the Historical data date time stamp live, currentTime : 2023-01-12 00:00:00+05:30 -- not showing H:M:S currentTime : 2023-01-12 00:00:00+05:30 -- not showing H:M:S currentTime : 2023-01-12 00:00:00+05:30 -- not showing H:M:S currentTime : 2023-01-12 10:00:00+05:30 -- this is some correct data,, currentTime : 2023-01-12 00:00:00+05:30 -- wrong time showing currentTime : 2023-01-12 00:00:00+05:30 -- wrong time showing currentTime : 2023-01-12 10:03:00+05:30 -- this is some correct data,,
def getHistoricalData(self, script, timeFrame): data = None try: data = self.util.kite.historical_data(script.scriptID, self.startDate, self.endDate, timeFrame, oi=True) return data
==================================================================================== data = self.getHistoricalData(script, timeFrame) if data is None: self.error = ErrorMessage("{} History data selection issues".format(script.scriptName), errCode=603, errType='KITE_ERROR', errDesc="{} History data selection had issues-----, Please debug".format(script.scriptName)) return self.error
================================================================================== # here my logic data_length = len(data) data_length = data_length - 1 currentTime = data.date[data_length] lastFrame = currentTime.strftime('%H:%M') print('currentTime : '+str(currentTime)) ---> here I am printing the date , see the below H:M:S are 00:00:00 coming
Output : See the below wrong time stamp in time data currentTime : 2023-01-12 12:42:00+05:30 currentTime : 2023-01-12 00:00:00+05:30 currentTime : 2023-01-12 00:00:00+05:30 currentTime : 2023-01-12 00:00:00+05:30 currentTime : 2023-01-12 12:42:00+05:30
00:00:00+05:30
for hours and minutes stamp. Complete date field will be eg:2022-11-22 00:00:00+05:30
For minute candle intervals, you will get values for hours and minutes. eg:
2022-11-22 09:15:00+05:30
wrong data coming during from the Historical data date time stamp live,
currentTime : 2023-01-12 00:00:00+05:30 -- not showing H:M:S
currentTime : 2023-01-12 00:00:00+05:30 -- not showing H:M:S
currentTime : 2023-01-12 00:00:00+05:30 -- not showing H:M:S
currentTime : 2023-01-12 10:00:00+05:30 -- this is some correct data,,
currentTime : 2023-01-12 00:00:00+05:30 -- wrong time showing
currentTime : 2023-01-12 00:00:00+05:30 -- wrong time showing
currentTime : 2023-01-12 10:03:00+05:30 -- this is some correct data,,
Please help me out
data = None
try:
data = self.util.kite.historical_data(script.scriptID, self.startDate, self.endDate, timeFrame, oi=True)
return data
====================================================================================
data = self.getHistoricalData(script, timeFrame)
if data is None:
self.error = ErrorMessage("{} History data selection issues".format(script.scriptName),
errCode=603, errType='KITE_ERROR',
errDesc="{} History data selection had issues-----, Please
debug".format(script.scriptName))
return self.error
==================================================================================
# here my logic
data_length = len(data)
data_length = data_length - 1
currentTime = data.date[data_length]
lastFrame = currentTime.strftime('%H:%M')
print('currentTime : '+str(currentTime)) ---> here I am printing the date , see the below H:M:S are 00:00:00 coming
Output : See the below wrong time stamp in time data
currentTime : 2023-01-12 12:42:00+05:30
currentTime : 2023-01-12 00:00:00+05:30
currentTime : 2023-01-12 00:00:00+05:30
currentTime : 2023-01-12 00:00:00+05:30
currentTime : 2023-01-12 12:42:00+05:30
I got the point by debugging, I am fetching Historical data for Index with Day timeframe.
So Day time frame cant be send time stamp.
After debugging so much I come know..
Thanks,
Veera