BracketOrder TargetLeg Modification

Hi -

I have created a BankNifty Bracket Order. I am trying to modify the price of Target and stoploss legs but its giving error:
{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘RS-9005’, ‘message’: ‘Transactions Fails.’}, ‘data’: ‘’}

Here is my latest payload I am testing using Dhan Python SDK
order = self.dhan.modify_order(
order_id = order_id,
order_type = ‘STOP_LOSS’,
leg_name = ‘TARGET_LEG’,
quantity = 15,
price = 0,
trigger_price = 405,
disclosed_quantity = 0,
validity = ‘IOC’
)

Here order_id is same as if master bracket order

I have tried different combination of parameters for orderType, price and trigger_price but nothings seems to work.

Does order modification of bracket order works or it has issues in general. Can someone suggest if I need to make any changes in payload.

@Hardik - Can you pls suggest on this.

1 Like

Hello @Shobhit_Agrawal

Welcome to Dhan Community!

Over here, validity cannot be IOC as IOC orders are immediately executed or cancelled. Try with DAY and let me know if this is working?

Hi @Hardik -

Tried validity as DAY but still it doesn’t work. tested payloads are as below. Also I have tried order_id same as of ENTRY_LEG and also with one for TARGET_LEG but it doesn’t work for either case.

order = self.dhan.modify_order(
order_id = order_id,
order_type = ‘MARKET’,
leg_name = ‘TARGET_LEG’,
quantity = 15,
price = 0,
trigger_price = 400,
disclosed_quantity = 0,
validity = ‘DAY’
)
{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘RS-9005’, ‘message’: ‘Transactions Fails.’}, ‘data’: ‘’}


order = self.dhan.modify_order(
order_id = order_id,
order_type = ‘LIMIT’,
leg_name = ‘TARGET_LEG’,
quantity = 15,
price = 406,
trigger_price = 405,
disclosed_quantity = 0,
validity = ‘DAY’
)

{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘RS-9005’, ‘message’: None}, ‘data’: ‘’}

Hello @Shobhit_Agrawal

Noted, will take a look into this and get back to you.