Learn Algo Trading with Python | Codes | Youtube Series

sir please use dhanhq 2.0

t Windows [Version 10.0.22631.4391]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Prabhash\Desktop\Dhan\3. Session3 - Codebase\3. Session3 - Codebase\Dhan codebase>py “Dhan_codebase usage.py”
Traceback (most recent call last):
File “Dhan_codebase usage.py”, line 6, in
from Dhan_Tradehull import Tradehull
File “C:\Users\Prabhash\Desktop\Dhan\3. Session3 - Codebase\3. Session3 - Codebase\Dhan codebase\Dhan_Tradehull.py”, line 1, in
from dhanhq import dhanhq
ModuleNotFoundError: No module named ‘dhanhq’

C:\Users\Prabhash\Desktop\Dhan\3. Session3 - Codebase\3. Session3 - Codebase\Dhan codebase>
I am struck here. Pls help in troubleshooting this

import pdb
from Dhan_Tradehull import Tradehull
import pandas as pd

client_code = “----------------”
token_id = “-----------------------------------”
tsl = Tradehull(client_code,token_id)

watchlist = [‘AXISBANK’, ‘ITC’, ‘HCLTECH’, ‘POWERGRID’, ‘BPCL’, ‘SBILIFE’, ‘HINDALCO’, ‘ADANIENT’, ‘WIPRO’, ‘NESTLEIND’, ‘TATAMOTORS’, ‘HDFCLIFE’, ‘SBIN’, ‘SUNPHARMA’, ‘ADANIPORTS’, ‘ONGC’, ‘HDFCBANK’, ‘SHRIRAMFIN’, ‘RELIANCE’, ‘TCS’, ‘ULTRACEMCO’, ‘COALINDIA’, ‘KOTAKBANK’, ‘BHARTIARTL’, ‘HEROMOTOCO’, ‘ASIANPAINT’, ‘TATACONSUM’, ‘TITAN’, ‘TATASTEEL’, ‘INFY’, ‘JSWSTEEL’, ‘CIPLA’, ‘APOLLOHOSP’, ‘TECHM’, ‘BRITANNIA’, ‘BAJFINANCE’, ‘BAJAJFINSV’, ‘MARUTI’, ‘BAJAJ-AUTO’, ‘M&M’, ‘GRASIM’, ‘HINDUNILVR’, ‘BEL’, ‘DRREDDY’, ‘EICHERMOT’, ‘ICICIBANK’, ‘TRENT’, ‘LT’, ‘NTPC’, ‘INDUSINDBK’]

for stock_name in watchlist:
chart = tsl.get_intraday_data(stock_name, ‘NSE’, 1)
print(stock_name)

pdb.set_trace()

when i run this code then this error come.
Solution plz

Hi @Md_Naquibuddin
Since the markets are closed thus no data.

Hi @Prabhash_Ranjan
No module named dhanhq, means installation issue.

check below link for installation

Hi @Zee2Zahid
check this link

I think that’s because market is closed, Try the same code on Monday, if the disconnections are too frequent do let me know.

1 Like

Also Happy Diwali everyone :diya_lamp:

2 Likes

Happy Diwali to @Tradehull_Imran Sir, @Dhan and to everyone

Thanks @Subhajitpanja … It works in market hours…

2 Likes

Sir, where can i get session 6 - 1st live Algo. zip file .

please guide me, sir…

Sir @Tradehull_Imran all is right before your eyes, its just the implementation of getting live data using dhan api , i only installed dhanhq package and python version is 3.12.6 and fedora linux …please try to understand i am just trying to get ltp without using excel why is that not possible?

Hello imran sir , session 1-7 my all codes are successfully running now but most of time I get the SSL issue , one guy on our forum who gives some commands i run that and resolve the issue for temporary ,i also tried given steps by you and followed many youtube videos to resolve but error occurs randomly.

Request you to teach stoploss, trailing stop loss, stop loss basis on candles , targets ,partially profit booking, Fibonacci , ATR, stoploss hunting ,demand supply zones,

I know I am expecting a lot (and I mean a lot)… but I know you’re the master who can make it all simple as ABC. you know, the whole shebang – in that legendary “Imran way,” it’d be a dream come true.

I might be expecting the moon, but hey, I know you can deliver it like a piece of cake!:hugs:

4 Likes

Sir,
Does that mean that we have to downgrade from dhan 2.0.0 to 1.3.3
Will it work in future

Dear Imran - i am not able to install or run install libraries.bat on my laptop (window) . so pl kindly look into and help me

Hi @Great_Islam
You are using python 3.1.3 , do use python 3.8.0 as in session2

Hi @Kishore007

Do check this link

1 Like

Hi @Hitesh_Maurya

Try : Market Quote - DhanHQ Ver 2.0 / API Document
This will help you to fetch ltp with rest api calls, no WebSocket and no excel required.

This will supported in upcoming Dhan_Tradehull_V2

1 Like

Hi @Happy_Life
we don’t need to write any algo for it,
This can be done in excel itself on tick by tick basis.

See this one:

Also do send your idea in detail.

Hi @Zee2Zahid
This issue will be addressed in Dhan_Tradehull_v2

2 Likes