{'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'}}
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
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")
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’}}