will function like below work ? calling itself if there is an error
def ltp_symbol(symbol):
try :
ltp = int(kite.ohlc(['NSE:' + symbol])['NSE:' + symbol]['last_price'])
except Exception as e:
print(e)
…
yeah that worked. But is there a way to give trading symbol here dynamically using a variable ? like below doesn't recognise CE_strike_symbol though that is a variable having actual symbol name
kite.ohlc['NFO:CE_strike_symbol']['last_price']