Cover order modification not understanding

=============================================================================================================
Hello All,

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).

Hello @kedar

Welcome to Dhan Community! Excited to see you explore Dhan APIs.

Yes, we have taken note of same Order ID for both legs of Cover Order, which is being generated by system. We will fix this bug where you are not getting details for both the legs in get_order_by_id(β€œ2123071026421”).

On Cover Order Modification, when you are modifying orders, you can add Order ID and add leg_name as STOP_LOSS_LEG. This will allow you to modify Stop Loss leg here.

Coming to get_tradebook(), it only shows executed trades and as long as the trade is not executed, you will not get the response there.