@aj_Brk Yes retrying working correctly, but I am not able to get the session token
Can you please share reference code
milind017
@milind017
Best posts made by milind017
-
RE: Guide to secure your SmartAPI Account with two factor authentication
Latest posts made by milind017
-
RE: Master instruments returns null
@admin Getting same issue now, can you please check
@balasoft80 Is there any trick to resolve it -
Unable to retrieve correct historical data
Re: Historical data for options
Even setting the 'todate' to '2022-10-27 15:30' in params I am only getting till '2022-10-25T15:15:00+05:30', expecting it to get till '2022-10-26 15:30'
Earlier same code was working correctly from yesterday unable to get the latest data
@admin Please check, due to this unable to place any tradeRef Code:
self.response=self.historyConn.getCandleData(historicParam)
print(self.response, (len(self.response['data'])))historicParam={'exchange': 'NSE', 'symboltoken': '10576', 'interval': 'THIRTY_MINUTE', 'fromdate': '2022-10-22 09:00', 'todate': '2022-10-27 15:30'}
Output: {'status': True, 'message': 'SUCCESS', 'errorcode': '', 'data': [['2022-10-25T09:15:00+05:30', 195.17, 195.17, 191.57, 193.36, 357473], ['2022-10-25T09:45:00+05:30', 193.44, 193.7, 193.34, 193.55, 224295], ['2022-10-25T10:15:00+05:30', 193.55, 193.55, 193.0, 193.0, 179914], ['2022-10-25T10:45:00+05:30', 193.01, 193.14, 192.78, 192.8, 95000], ['2022-10-25T11:15:00+05:30', 192.8, 192.93, 192.69, 192.7, 66680], ['2022-10-25T11:45:00+05:30', 192.76, 193.12, 192.61, 192.99, 189864], ['2022-10-25T12:15:00+05:30', 193.0, 193.02, 192.65, 192.66, 74777], ['2022-10-25T12:45:00+05:30', 192.7, 192.89, 192.6, 192.67, 43976], ['2022-10-25T13:15:00+05:30', 192.65, 192.98, 192.61, 192.95, 57924], ['2022-10-25T13:45:00+05:30', 192.95, 193.08, 192.83, 193.0, 49293], ['2022-10-25T14:15:00+05:30', 193.0, 193.07, 192.83, 193.02, 65981], ['2022-10-25T14:45:00+05:30', 193.0, 193.05, 192.5, 192.54, 132818], ['2022-10-25T15:15:00+05:30', 192.5, 192.54, 192.28, 192.49, 178768]]} -
RE: Guide to secure your SmartAPI Account with two factor authentication
@SSumit Yes its exactly same except secret key and client id
-
RE: Guide to secure your SmartAPI Account with two factor authentication
@aj_Brk Yes retrying working correctly, but I am not able to get the session token
Can you please share reference code -
RE: Guide to secure your SmartAPI Account with two factor authentication
@Ashok Yes I have already tried with totp as string still its same
Yes retry not needed by still to be sure.
I have added both code to check if I am getting the same totp, which I am getting but still not able to get the success
Is pyotp is working for you? -
RE: Guide to secure your SmartAPI Account with two factor authentication
@SSumit
I have tried with shared link code, still getting the same
Shell Output:
with TOTP: 932310
With parse_uri: 932310
{'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None} -
RE: Guide to secure your SmartAPI Account with two factor authentication
@Ashok Yes did the same. Still getting the same
obj = SmartConnect(api_key=historyApiKey)totp = pyotp.TOTP(s='secret key in qr uri after qr generation')
print("pyotp",totp.now())attempts = 5
while attempts > 0:
attempts = attempts-1
data = obj.generateSession(clientCode, password, totp.now())
print(data)
if data['status']:
break
time.sleep(2) -
RE: Guide to secure your SmartAPI Account with two factor authentication
@aj_Brk code generated from "pyotp" not working for me, getting below output with your code. Any suggestion. If I am using the code from DUO app I am able to login successfully
data = obj.generateSession(clientCode, password, totp.now())
print(data)Shell output:
pyotp: 586380
{'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None}