Error in get_historical_data and get_ltp_data()

Got Error when executng the script..
File “C:\Users\Admin\PycharmProjects\PythonProject1.venv\Lib\site-packages\Dhan_Tradehull\Dhan_Tradehull.py”, line 766, in get_historical_data
raise Exception(ohlc)

this was working earlier but now facing issues

Hi @Sudhakar_Prabhakar ,

We have updated the codebase .

Do run this command on the cmd -

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

Refer the code -

from Dhan_Tradehull import Tradehull

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

ltp = tsl.get_ltp_data('NIFTY')
print(ltp)

hist = tsl.get_historical_data('NIFTY', exchange = 'INDEX', timeframe = '1')
print(hist)

Output -

Thanks sir..could able to retrieve the data after installing the below version
pip install dhanhq==2.2.0
pip install Dhan-Tradehull==3.3.1

Hi @Sudhakar_Prabhakar ,

Yes, data retrieval will work. These commands are primarily used to upgrade the codebase to the latest compatible versions.