I need help in modifying the cover order. But I am little confused with the API responses.
Basically my requirement is: after placing cover order, I should be able to modify the price of stop_loss_leg whenever required and able to fetch the modified price whenever required.
When I place the cover order obviously two orders will get placed. one order with ENTRY_LEG and one order with STOP_LOSS_LEG. So the confusion started here with both orders are given same order id.
tried fetching order list using get_order_list()
I expected different order id for each leg, however I can differentiate using LEG names, price and trigger price. Here trigger price is the stop loss price that I have set.
when i am fetching results for get_order_by_id(“2123071026421”), it is giving only ENTRY_LEG order details only, this order id contains both entry leg and stop loss leg right?
response of get_order_by_id(“2123071026421”). It gives only buy order details?
so for modification of order If i want to change the price of stop loss leg, can i change trigger price for the same order id?
If I want to retreive the modified price of stop loss leg, which api and attribute gives that?
and when i am trying to fetch all orders of a order using order id → dhan.get_trade_book(“2123071026421”) , response doesn’t have attributes price, trigger price and stop loss leg.
and again get_tradebook() response doesn’t have have attributes of stop loss leg order (price, trigger price and stop loss leg).