Getting 'DH-905' while calling get_intraday_data()

Error :

{'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:\Algo using Dhan\Sessions\Session6\6. Session6- 1st Live Algo\1st live Algo\Dhan_Tradehull_V2.py", line 561, 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 t
o 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'}}

code :

from Dhan_Tradehull_V2 import Tradehull
import pandas as pd

client_code = "**"
token_id = **"
tsl = Tradehull(client_code,token_id)
tsl.get_intraday_data("MOTHERSON", 'NSE', 1)
pdb.set_trace()

please note I am using updated Tradehull lib.
Name: dhanhq → Version: 2.0.2
Name: Dhan_Tradehull → Version: 3.0.6

getting same error here i tried a lot…

Yesterday’s night successfully created and run on same machine but from today morning same error found

all codes worked but while running with ‘get.intraday_data’ error occurs

Same here… code worked till yesterday not giving this error…
@Tradehull_Imran Sir, could you please help?

use get_historical_data instead of get_intraday_data… i think its worked

Thanks Vinu. It is working with get_historical_data()

i replace historical data instead of intraday data… but i got another error as below

MOTHERSON
Exception in Getting OHLC data as ‘int’ object has no attribute ‘upper’
Traceback (most recent call last):
File “Dhan_codebase usage.py”, line 29, in
chart[‘rsi’] = talib.RSI(chart[‘close’], timeperiod=14) #pandas
TypeError: ‘NoneType’ object is not subscriptable

Both are different function and their work also different…

Hi @Sunny_Shah

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.

Retrieve historical or intraday data:

Get Historical Data

  • tsl.get_historical_data(tradingsymbol: str, exchange: str, timeframe: str, debug: str = “NO”)
    • Arguments:
      • 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")
1 Like

same error here

Exception in Getting OHLC data as {‘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’}}

Hi @Vindhyawasini ,

Share your code the review the same.