It looks like you're new here. If you want to get involved, click one of these buttons!
def get_ltp(kite, trading_exchange, contract_name):
while True:
try:
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)
return float(ltp)
except exceptions.KiteException as e:
logging.info("Exception occurred while getting ltp: \n %s", e.args)
continue
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?