Learn Algo Trading with Python | Codes | Youtube Series

also when use pd.get_trace() in Dhan_codebase usage.py code and run like below i get below error
(Pdb) available_balance = tsl.get_balance()
Error at Gettting balance as ‘Tradehull’ object has no attribute ‘Dhan’
”Dhan” is not there in Tradehull.
Can you please help fixing this.

Hi @Ashish_Shukla ,

The code has been updated. Kindly use the latest version of the code.

Refer the link -

Thanks a lot i will check this.

1 Like

Attempting authentication using PIN + TOTP.
Enter current TOTP (6-digit):

what i need to pass here my mpin ? i passed mpin but not working

this comes when i run → py “Dhan_codebase usage.py”

Hi @Ashish_Shukla ,

The PIN refers to the 6-digit login code used to login the Dhan web account.

Steps to Set Up / Get TOTP Key in Dhan:

  1. Log in to your Dhan web account.

  2. Go to your Profile section and open Get Trading & Data APIs.

  3. Click on “Set-up TOTP” under Optional Settings.

  4. Verify using the OTP sent to your registered email/mobile and scan the QR code using an authenticator app.

  5. In this you will find the TOTP Key before finishing setup need to copy and paste it separately.
    Ex - (TOTP key - P65KE2W57AKTUK4ABCKBJIAKIQNGNEJSB)

  6. Enter the 6-digit code from the app to complete the setup.

Thanks a lot @Tradehull_Imran , currently going through your “Algo Trading with Python Masterclass“ series, code is somewhat updated thanks for all your help .
One doubt i have like i logined into my account through code now it will be automatically logged out when program ends correct ? just for safety purpose i want to know.

Hi @Ashish_Shukla ,

Yes, once the program execution is completed, the session will be automatically logged out.

1 Like

asking for permission

Hi @Ranjit_Kumar2 ,

The required permission has been provided. The drive link can now be accessed.

sir app downlode ma error ha can u help me sir

sir ake error ha can u solve it

Hi @Ammar_parihar ,

Do run the command on the cmd -

pip install scipy
pip install ta

sir is ka installation ki file kahan se milegi please link de dijiega

Pls send me link to download files to install and Learn coding

thankq sir

1 Like

Hi @HASAN_khan ,

We have updated it .

Refer this link -

Refer this link for code -

Hi @Nagraj_Seetharamiah ,

We have updated it .

Refer this link -

Refer this link for code -

Thanks

Hello Imran sir
Dhan API can work outside of India?

Hi @ajit_1

Yes if we have a Dhan account we can access Dhan api, irrespective of our geo location.

API calls themselves work fine from any location we just need a static whitelisted IP per the SEBI rule.