File name: how to use updated codebase.py
Errors :
C:\Users\ADMIN\Desktop\Workspace\3.1 Codebase Upgrade\3.1 Codebase Upgrade>python “How to use updated codebase.py”
Codebase Version 3
-----Logged into Dhan-----
reading existing file all_instrument 2025-03-08.csv
Got the instrument file
[0] > ←[33;01mc:\users\admin\desktop\workspace\3.1 codebase upgrade\3.1 codebase upgrade\how to use updated codebase.py←[00m(←[36;01m17←[00m)()
→ ltp = tsl.get_ltp_data(names = [ “ACC”, “CIPLA”])
(Pdb++) ltp = tsl.get_ltp_data(names = [ “ACC”, “CIPLA”])
Exception at calling ltp as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: None, ‘error_type’: None, ‘error_message’: None}, ‘data’: {‘data’: {‘806’: ‘Data APIs not Subscribed’}, ‘status’: ‘failed’}}
(Pdb++) acc_ltp = all_ltp_data[‘ACC’]
*** NameError: name ‘all_ltp_data’ is not defined
(Pdb++) pe_ltp = all_ltp_data[‘NIFTY 19 DEC 24000 PUT’]
*** NameError: name ‘all_ltp_data’ is not defined
(Pdb++) stock_name = ‘NIFTY’
(Pdb++) ltp = tsl.get_ltp_data(names = [stock_name])[stock_name]
Exception at calling ltp as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: None, ‘error_type’: None, ‘error_message’: None}, ‘data’: {‘data’: {‘806’: ‘Data APIs not Subscribed’}, ‘status’: ‘failed’}}
*** KeyError: ‘NIFTY’
(Pdb++)
Exception at calling ltp as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: None, ‘error_type’: None, ‘error_message’: None}, ‘data’: {‘data’: {‘806’: ‘Data APIs not Subscribed’}, ‘status’: ‘failed’}}
*** KeyError: ‘NIFTY’
(Pdb++)
Same code seems to work on your computer on the web but on my mc it dowss ont work.
Thanks