The pattern which I am seeing is that whenever I loop through, and place order one by one, one of the account breaks and I get an error the error of could not authenticate user.
However, this doesn’t make sense, if by creating a fyers object results into breaking of the authentication code, it should happen in both the accounts. There is no pattern randomly one of them breaks, the other one runs fine.
`for x in range(len(login_details)):`
app_id=login_details['app_id'].iloc[x]
#access_token_path= 'Fyers_access_token.txt'
access_token= login_details['access_token'].iloc[x]
fyers = fyersModel.FyersModel(client_id=app_id, token=access_token)
` place_order(fyers,stock,order_type,quantity,strike_buy)`
So I read, generate the access token once during the day and store it in login_details dataframe. Then at the time of trade, I loop through this and create fyers object with this application and it’s access token, pass it to the place order function and fire the trade there.
Now during the order placement, one of the accounts result into the error : Could Not Authenticate User. Now, there is no pattern randomly one of the account gets blocked and I need to generate access token again, and then everything works fine and then again after order placement something goes south.