while True: if (datetime.now().second == 0) and ((datetime.now().minute) % 5 == 0): for token in tokens: records = kite.historical_data(token,from_date=from_date,to_date=to_date,interval=interval) df = pd.DataFrame(records) df.drop(df.tail(1).index, inplace=True)
print(df)
open = df['open'].values high = df['high'].values low = df['low'].values close = df['close'].values volume = df['volume'].values
records = kite.historical_data(token,from_date=from_date,to_date=to_date,interval=interval)
You don't seem to have a Historical data APIs subscription. It's an add-on you need to subscribe to it from the connect developer page. Refer FAQs here.