while True:
for api_info in api_data.get('api_keys', []):
time.sleep(5)
api_key = api_info.get('api_key', '')
with open('access tokens list.txt', 'r') as fp: # to read a json file
hya = json.load(fp)
…
in this code,
i) if enter_into_trade is executed: when i try to fetch last_price using websockets, it shows keyerror:Last_price.
ii) if enter_into_trade is not executed (maybe because it is not the right time now): when i try to fetch last pric…