def get_ltp(kite, trading_exchange, contract_name):
temp_list = [trading_exchange + ':' + contract_name]
ltp = kite.ltp([temp_list])
temp_list = trading_exchange + ':' + contract_name # convert temp_list to string
ltp = ltp[temp_list]['last_price']
logging.info("LTP of the contract is: %s", ltp)
except exceptions.KiteException as e:
logging.info("Exception occurred while getting ltp: \n %s", e.args)
We haven't observed any such error at our end. Anyhow, we will log today's data to see, if any.
We logged LTP and Quote request-response for almost the whole day and weren't able to encounter anything unusual.
To catch the read timeout exception is below good enough?