Downloaded py files from Google Drive not working

I have downloaded py files from Google Drive link but when I try to run them, showed error. Why so

Hi @GautamB ,

Share the screenshot of the error .

1 Like

Also I want an code that fetch the value of 33 EMA high and 33 EMA low in 3 min candle time frame option chart. Based on that I want to trade that instrument on some logic

Hi @GautamB ,

Do run the below commands in cmd terminal-

pip install dhanhq==2.2.0
pip install Dhan-Tradehull==3.3.0

Follow the remaining steps :

Step 1: Run the following command:

pip show Dhan_tradehull

Step 2: Copy the location path shown in the output, similar to the example below:

c:\users\Test\appdata\local\programs\python\python310\lib\site-packages

Step 3: Paste the copied path into File Explorer.

Step 4: Search for the Dhan_Tradehull folder and open it.

Step 5: Locate the Dhan_Tradehull.py file and open it.

Step 6: Search for the following line (CTRL + F):

['1','5', '15', '25', '60']

Step 7: Replace it with the following and save the file to use the 3 min timeframe of the data(CTRL + S):

['1','2','3', '5', '15', '25', '60']

After these steps refer the code provided below -

Refer the code -

from Dhan_Tradehull import Tradehull

client_code = ""
tsl = Tradehull(client_code, mode="pin_totp", pin="", totp_secret="")

hist = tsl.get_historical_data('NIFTY 19 MAY 24000 CALL', exchange = 'NFO', timeframe = '3')

hist["ema_h"] = round(hist['high'].ewm(span=33).mean(),2)
hist["ema_l"] = round(hist['low'].ewm(span=33).mean(),2)

print(hist)

Hi @GautamB ,

Do run the below commands in cmd terminal-

pip install dhanhq==2.2.0
pip install Dhan-Tradehull==3.3.0

Refer this link for the updated files -

Connect Error → server rejected WebSocket connection: HTTP 429

Hi @GautamB ,

Refer this link for the updated file -