for sym in [“TRENT”, “RELIANCE”, “BANKNIFTY”, “SENSEX”]:
print(sym)
print(tsl.get_ltp_data(names=\[sym\]))
Problems is sometimes i am getting exception .
TRENT
{‘TRENT’: 3270.8}
RELIANCE
Exception at calling ltp as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: None, ‘error_type’: None, ‘error_message’: None}, ‘data’: ‘’}
{}
BANKNIFTY
{‘BANKNIFTY’: 57779.85}
SENSEX
Exception at calling ltp as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: None, ‘error_type’: None, ‘error_message’: None}, ‘data’: ‘’}
{}
Live Prices: {‘NIFTY’: 23966.5, ‘SENSEX’: 76762.75, ‘CRUDEOIL’: 6603.0, ‘TRENT’: 3271.0}
sometimes I will get correct .
