Learn Algo Trading with Python | Codes | Youtube Series

sir geeting this error on calling historical data

Hello Sir,

After running “Dhan_websocket.py”, I am getting this error. I have updated my client id and token id in codes. Please help me to solve this.

How can I use this code for getting option strikes of Crudeoil MCX here:
ce_name, pe_name, strike = tsl.ATM_Strike_Selection(‘NIFTY’, ‘31-10-2024’)

I tried many variables LIKE THIS but was not successful
ce_name, pe_name, strike = tsl.ATM_Strike_Selection(‘CRUDEOIL’, ‘15-11-2024’)
ce_name, pe_name, strike = tsl.ATM_Strike_Selection(‘CRUDEOIL’, ‘CRUDEOIL NOV 15’)

Please @Tradehull_Imran give codes for Crudeoil MCX options

1 Like

Disconnected from WebSocket feed.
WebSocket connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
Sir Error coming pls help

Hi @Faham_Ali

Do check the link and follow each step … and run file again

do let me know if it works after the changes

Hi everyone,
please remove your api_key while sharing code on community or to tradehull_mentorship@tradehull.com

2 Likes

Hi @Zee2Zahid
MCX options is not supported in Dhan_Tradehull codebase as of now, will add this request in upcoming release.

1 Like

chatgpt says that this line is not correct
].iloc[-1][‘SEM_SMST_SECURITY_ID’]
thats why im not able to proceed further in session 3
and so data frame in empty in our case says single positional indexer is out-of-bounds for SENSEX 06 SEP 78500 PUT
kindly help

@Tradehull_Imran Sir Activate Dhan Api & Dhan Data but & Update Dhan Websocket but showing this eror
Disconnected from WebSocket feed.
WebSocket connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

Hi @jain79
SENSEX 06 SEP 78500 PUT
is a expired contract. do remove these and try again

Do check the link and follow each step … and run file again

do let me know if it works after it

Hi @Dinesh_Sharma @ddeogharkar @Abhishek_Konda @ShantiPar66

In case of SSL: CERTIFICATE_VERIFY_FAILED Use below methods one by one,
after completing each method try to run the code again to check if SSL issue is still there, if it is… then goto next step

SSL issue is mostly created when we use office laptop or vpn

  1. Install CERTIFI
    Press Windows + R.
    Type cmd and hit Enter. This opens the Command Prompt.
    In the Command Prompt window, type the following command
    pip install certifi --upgrade
    and press Enter, (this will update cerifi package)

  2. Disable SSL check
    I am giving you a new file Dhan_websocket SSL_issue_fixed.py
    instead of running Dhan_websocket.py, now run Dhan_websocket SSL_issue_fixed.py
    Dhan_websocket SSL_issue_fixed.py - Google Drive

  3. Update Certificates
    Press Win + S to open the search bar.
    Type PowerShell.
    Right-click on Windows PowerShell from the search results.
    Select Run as administrator.
    If prompted by User Account Control (UAC), click Yes.

    Now run following two commands one by one:
    certutil -generateSSTFromWU roots.sst
    certutil -addstore -f root roots.sst

    Thanks @ABCDIt for PowerShell solution

  4. Change Laptop and Network
    Most probably the issue is fixed by now, but if we still we find SSL issue, maybe a quicker method would be to

    a) run the code on your home laptop and your home internet

    b) install files on AWS free 2GB server and test the same. There we would have a Free + Dedicated + Secure + Enough Bandwidth environment, and the files would run normally there.

5 Likes

Thank you sir @Tradehull_Imran n thanks to @Zee2Zahid for asking this valuable question

Hi @ashish_jain

  1. Send me error and code screenshot also

  2. Did you make any changes to Dhan_Tradehull.py

  3. You seems to be running Dhan_codebase usage -copy.py.
    try running it on Dhan_codebase usage.py and see if any difference

  4. previous_hist_data = tsl.get_historical_data(‘ACC’,‘NSE’,12) was hit inside pdb
    try running the same command without pdb

  5. Let me know if you have subscription to Data api

Try above solutions one by one. and also let me know if it is solved

1 Like

Its working fine now… LTP sheet is updating in Live market only… Thanks for the reply…

1 Like

@Tradehull_Imran Sir problem is resolve thank you

1 Like

Hi Sir, Can anyone help me install Algo Trading (AnyDesk Platform) with Python Episode 2 - as per instructions by Ali sir. I am a senior citizen. I have downloaded but got heldup with cmd command. Please help me to resolve the issue. VBR Prasad - 9949324446

Sir, I could not find the code in this window for Episode 3

Sir, I could not trace out the full code of Episode 3 here anywhere. Please guide me.

Hi @Vasili_Prasad

Session 3 :3. Session3 - Codebase.zip - Google Drive
Session 4: 4. Session4- Python Part 1.zip - Google Drive

2 Likes

Hi @Tradehull_Imran ,

Thanks a lot.

I can crack it by using the below solution

Update Certificates
Press Win + S to open the search bar.
Type PowerShell.
Right-click on Windows PowerShell from the search results.
Select Run as administrator.
If prompted by User Account Control (UAC), click Yes.

Now run following two commands one by one:
certutil -generateSSTFromWU roots.sst
certutil -addstore -f root roots.sst

and I have used the attached updated websocket file

Thanks,

Devendra

2 Likes