Please help error comes , what going wrong in code line 569, in get_intraday_data
– Processing Day: 2025-08-21 —
{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-905’, ‘error_type’: ‘Input_Exception’, ‘error_message’: ‘System is unable to fetch data due to incorrect parameters or no data present’}, ‘data’: {‘errorType’: ‘Input_Exception’, ‘errorCode’: ‘DH-905’, ‘errorMessage’: ‘System is unable to fetch data due to incorrect parameters or no data present’}}
Traceback (most recent call last):
File “d:\Dhan Practice\Dhan_Tradehull.py”, line 569, in get_intraday_data
raise Exception(ohlc)
Exception: {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-905’, ‘error_type’: ‘Input_Exception’, ‘error_message’: ‘System is unable to fetch data due to incorrect parameters or no data present’}, ‘data’: {‘errorType’: ‘Input_Exception’, ‘errorCode’: ‘DH-905’, ‘errorMessage’: ‘System is unable to fetch data due to incorrect parameters or no data present’}}
tsl.get_intraday_data was a old method to get historical data… it gives data only for today, which makes problem if we want to create indicators on it.
Dhanhq was upgraded and now we can use get_historical_data which gives data for last 5 working days.
tradingsymbol (str): The trading symbol for the instrument you want to fetch data for (e.g., ‘NIFTY’, ‘ACC’).
exchange (str): The exchange where the instrument is traded (e.g., ‘NSE’, ‘INDEX’).
timeframe (str): The timeframe for the data. It can be:
‘1’ for 1-minute candles
‘5’ for 5-minute candles
‘15’ for 15-minute candles
‘25’ for 25-minute candles
‘60’ for 60-minute candles
‘DAY’ for daily candles
debug (optional, str): Set to “YES” to enable detailed API response logging. Default is “NO”.
Sample Code:
data = tsl.get_historical_data(tradingsymbol='NIFTY', exchange='INDEX', timeframe="DAY")
data = tsl.get_historical_data(tradingsymbol='ACC', exchange='NSE', timeframe="1")
Also do update to our latest codebase version 3.0.6:
Open Command Prompt: Press Win, type cmd, and press Enter.
Install Dhan-Tradehull: Run pip install Dhan-Tradehull
Confirm the installation by running pip show Dhan-Tradehull