I am getting following error while trying to obtain historical daily data
Same difficulty while trying to obtain intraday data
have u got response ?
Hello @affroz
Apologies for missing this thread. This looks like a configuration issue. Kindly make sure dhanhq
library is installed in correct environment and it is updated to version 1.2.3 or later.
Sorry, but I am not seeing any option to create a new thread. Hence I am posting here
I am facing error while downloading daily_historical_data. I am using dhanhq v 2.1.0.
security_id_str = “1333”
security_id_int = int(security_id_str)
ohlc = dhan.ohlc_data(
securities = {“NSE_EQ”:[1333]}
)
print(ohlc)
ohlc2 = dhan.ohlc_data(
securities = {“NSE_EQ”:[security_id_int]}
)
print(ohlc2)
{‘status’: ‘success’, ‘remarks’: ‘’, ‘data’: {‘data’: {‘NSE_EQ’: {‘1333’: {‘last_price’: 1964.7, ‘ohlc’: {‘open’: 1931.6, ‘close’: 1964.7, ‘high’: 1969.9, ‘low’: 1931.6}}}}, ‘status’: ‘success’}}
{‘status’: ‘failure’, ‘remarks’: {‘error_code’: None, ‘error_type’: None, ‘error_message’: None}, ‘data’: ‘’}
I have tried to change it to str as well as int but getting same error in both cases, what am I doing wrong?