This historical fetch was working ok till a few days back. Now I get the DH-907 error.
id = “13”
d = dhan.historical_daily_data(security_id=str(id),exchange_segment=dhan.NSE,instrument_type=‘EQUITY’,expiry_code=int(0),from_date=“2024-12-18”,to_date=“2024-12-22”)
is returning
{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-907’, ‘error_type’: ‘Data_Error’, ‘error_message’: ‘System is unable to fetch data due to incorrect parameters or no data present’}, ‘data’: {‘errorType’: ‘Data_Error’, ‘errorCode’: ‘DH-907’, ‘errorMessage’: ‘System is unable to fetch data due to incorrect parameters or no data present’}}
I dont want to use tradehull because its too heavy and I dont need most of the features there. The above fetch has been in my code for months but after 2.0, the behavior is flaky.
Intraday fetch as below works without issues:
today = date.today()
thirty_days_ago = date.today() - timedelta(days=180)
five_days_ago = date.today() - timedelta(days=5)
dhan.intraday_minute_data(id,dhan.NSE,“EQUITY”,from_date=str(five_days_ago),to_date=str(today))
Can you guide?