Kotak-Neo / kotak-neo-api

112 stars 103 forks source link

subscribe to orderfeed not working #188

Open shitizbansal247 opened 3 months ago

shitizbansal247 commented 3 months ago

showing error: {'type': 'order_feed', 'data': '{"ak":"nk","type":"cn","task":"cn","msg":"Authentication Failed"}'}

my code: from neo_api_client import NeoAPI def on_message(message): print(message) def on_error(error_message): print(error_message) def on_close(message): print(message) def on_open(message): print(message)

client = NeoAPI(consumer_key="xxxxxxx", consumer_secret="x", environment='prod', access_token=None, neo_fin_key=None)

client.login(mobilenumber="+xxxxxx", password="xxxxxxxx.") otp = input("enter otp: ") client.session_2fa(OTP=otp)

client.on_message = on_message
client.on_error = on_error
client.on_close = on_close
client.on_open = on_open client.subscribe_to_orderfeed()

crypt0inf0 commented 3 months ago

Does everything else working? Can you check client.holdings()

shitizbansal247 commented 3 months ago

yes i can check client.holdings() just fine. as well as client.order_report()

crypt0inf0 commented 3 months ago

Try deleting the kotak-neo-api folder and try to reinstall using

pip install --force-reinstall "git+https://github.com/Kotak-Neo/kotak-neo-api
shitizbansal247 commented 3 months ago

yes i deleted and made a fresh install. still it shows authentication failed. please help. all other things are working like limits, positions, holdings etc.

crypt0inf0 commented 3 months ago

I'm sorry, I don't know what's the issue. I don't use order feed because it will keep disconnecting after 5 to 10 minutes.

shitizbansal247 commented 3 months ago

thanks anyways crypt0inf0. just a small query. actually i used client.order_history() and client.order_report() for fetching order status but they sometimes give null value. so i thought of trying orderfeed. are you ok with working with client.order_history() ?

crypt0inf0 commented 3 months ago

I only use the api to place and modify orders.