Closed ashish5051 closed 5 months ago
AttributeError Traceback (most recent call last) Cell In[3], line 14 12 lastBusDay = datetime.datetime.today() - datetime.timedelta(days=3) 13 lastBusDay = lastBusDay.replace(hour=0, minute=0, second=0, microsecond=0) ---> 14 ret = api.get_time_price_series(exchange='NSE', token='22', starttime=lastBusDay.timestamp(), interval=5) 15 pdb.set_trace()
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\NorenRestApiPy\NorenApi.py:889, in NorenApi.get_time_price_series(self, exchange, token, starttime, endtime, interval) 887 # 888 values = {'ordersource':'API'} --> 889 values["uid"] = self.__username 890 values["exch"] = exchange 891 values["token"] = token
AttributeError: 'ShoonyaApiPy' object has no attribute '_NorenApi__username'
Have you found any solution for this ?
NO, I'm asking for solution
Greetings from Shoonya!
As we checked, its working fine. Please refer to the attached input and output of the code:
AttributeError Traceback (most recent call last) Cell In[3], line 14 12 lastBusDay = datetime.datetime.today() - datetime.timedelta(days=3) 13 lastBusDay = lastBusDay.replace(hour=0, minute=0, second=0, microsecond=0) ---> 14 ret = api.get_time_price_series(exchange='NSE', token='22', starttime=lastBusDay.timestamp(), interval=5) 15 pdb.set_trace()
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\NorenRestApiPy\NorenApi.py:889, in NorenApi.get_time_price_series(self, exchange, token, starttime, endtime, interval) 887 # 888 values = {'ordersource':'API'} --> 889 values["uid"] = self.__username 890 values["exch"] = exchange 891 values["token"] = token
AttributeError: 'ShoonyaApiPy' object has no attribute '_NorenApi__username'