Marketfeed code showing error

My code as given by you @Hardik

The error I’m getting:
Screenshot 2024-09-19 203154

Hi Disha,

If you are using the dhanhq version 1.3.2 , then there it expects only the below value as argument :

marketfeed.DhanFeed(client_id, access_token, instruments).

Remove the on_connect and try running your code.

Thanks !!!

I tried that but now I’m getting this error:

Subscription code : 15
Authorizing…
Authorization successful!
Traceback (most recent call last):
File “/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py”, line 31, in
start(fakepyfile,mainpyfile)
File “/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py”, line 30, in start
exec(open(mainpyfile).read(), main.dict)
File “”, line 26, in
File “/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/asyncio/tasks.py”, line 371, in create_task
loop = events.get_running_loop()
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop

Hello @disha

Can you confirm if you are using in 1.3.2, you are using this get started code?

I tried this now and got this error:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)
c:\Users\DISHA\Documents\Python\AlgoTrading\LTP.py:32: RuntimeWarning: coroutine ‘DhanFeed.disconnect’ was never awaited
data.disconnect()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

hi @disha,

I got the same error, i uninstalled dhanhq and asyncio, and re installed it gave other error which I posted in this group.

Hi @disha @kgselvam ,

I tried this and it worked for me.

I actually tried a different way and now I’m able to fetch ltp. The ssl certificate issue is also not there anymore

1 Like

Hi @Sai_Chandra ,

Thanks. I got it solved in a different way.

Hi @Sai_Chandra ,

Thanks for the suggestion, though I solved ssl error the other errors were coming up which i have posted in this forum with other topic, I tried your suggesstion it worked without re installing python, Now i am able to connect to dhan, Thank you.

2 Likes