It looks like you're new here. If you want to get involved, click one of these buttons!
while days > 0: df_temp = pd.DataFrame() from_date = datetime.now() - timedelta(days=days) to_date = from_date + timedelta(days=30) download_try = 0 while df_temp.empty == True and download_try <= 10: try: #time.sleep(0.5) download_try = download_try+1 records = self.kite.historical_data(self.instrument_token\ ,from_date,to_date,self.interval,continuous=False) df_temp = pd.DataFrame(records, columns=[ 'volume', 'high', 'low', 'date','close','open' ]) self.df = self.df.append(df_temp,sort=False,ignore_index=True) except: print("%s GHD Try %d"%(self.symbol,download_try)) pass days -= 30