Learn Algo Trading with Python | Codes | Youtube Series

hi @Khandu_Kshirsagar
.whl is not a supported wheel on this platform.

this particular error means, that python and .whl version is not matching.
You sems to have another python version except 3.8.0 ,

do uninstall python and reinstall from python 3.8.0

Hi Imran


I did all steps as you mentioned in above post. Also took subscription of Data Api. But still problem persist. There is WebSocket connection error: init() got an unexpected keyword argument ‘on_connect’ and loop continue with Fetching LTP. Excell is not updating with latest LTP and other data.

Hi,
I am also facing the same issue, I have followed all the steps. LTP is not updating. Can you please cover this in the next session I have seen a few people facing this issue.

Same for me as well

hi @CBrid @ddeogharkar @Subhajitpanja

Please check if in Dhan_websocket.py , in access_token variable, you need to put the token_id that we copied after making the api.

  1. open Dhan_websocket.py
  2. replace your token_id into access token

reference

let me know if it works,

if not. please send me your zip of the entire folder that you are working on, (use google drive link and share with tradehull_mentorship@tradehull.com)

I hv shared my zip folder. Please check.

hi @CBrid

we have checked the files you shared, Dhan_websocket.py seems to be working fine.
do run it again and see if it updates


Same problem

It seems there is a dhanhq version mismatch.

Dhan api have been updated to v1.3.3,

we will update the code to 1.3.3 and share it , ETA 1-2 days.

Okay

Kindly also share how to do it ourselves in the future

Works fine for python version 3.13.0

Left: similiar to provided code
Right: test for talib

2 Likes


I have subscribed to Dhan Api paid version.
Updated token and client id in the beginning
Removed all expired contracts from excel
but still same error.

Hi
@CBrid @ddeogharkar @Subhajitpanja @KalpaTrader @PRS

we have upgraded Dhan_websocket.py to match with dhanhq 1.3.3
Now just delete the existing Dhan_websocket.py and replace it with new Dhan_websocket.py

link for new Dhan_websocket.py : Dhan_websocket.py - Google Drive

also let me know if it works fine or still any issues

4 Likes

Works like a charm till previous hist data. :+1: will check more and update. btw a quick question: should we keep running the websocket command or pause it as it keeps fetching ltp?

1 Like

we should keep it running.

Thank you sir. I will try and let you know

This is working now :slight_smile: Thanks.
2 doubts:
1- do we have to stop the code and rerun every time we add a new instrument?
2- how to future proof the code, it might need another edit with new dhan api updates ?

1 Like

Working…

1 Like
  1. we don’t need to stop the code to add new script.
  2. Yes dhanhq might get a new update in future, when it happens we will release the latest file here.
1 Like