buy_entry_orderid = tsl.order_placement('NIFTY 14 NOV 24000 PUT','NFO', 25, 0, 0, 'MARKET', 'BUY', 'MIS')
order_status = tsl.get_order_status(orderid=buy_entry_orderid)
if order_status == "TRADED":
print("I have double checked Order Completed")
order_price = tsl.get_executed_price(orderid=buy_entry_orderid)
sl_price = round((order_price*0.98),1)
sl_orderid = tsl.order_placement('NIFTY 14 NOV 24000 PUT','NFO', 25, 0, sl_price, 'STOPMARKET', 'SELL', 'MIS')
order_status = tsl.get_order_status(orderid=sl_orderid)
if order_status == "TRADED":
print("Stoploss Hit")
type or paste code here
output -
Traceback (most recent call last):
File “/home/mohan/Dhan-Alog-Trading/examples/Dhan_Tradehull_V2.py”, line 138, in order_placement
orderid = order[“data”][“orderId”]
~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: ‘orderId’
‘62241112378127’