I have first placed a bracket order on the current order.
But now when I am trying to edit the bracket order through bracket order url i.e. requests.put(‘https://api.india.delta.exchange/v2/orders/bracket’, headers=headers, data=body)
and params = {
“id”: 257702521,
“product_id”: 27,
“product_symbol”: “BTCUSD”,
“bracket_stop_loss_limit_price”: “95235”,
“bracket_stop_loss_price”: “95230”,
“bracket_stop_trigger_method”: “last_traded_price”
}
Then it says that there is no open order.
Please let me know if there’s a way to edit the stop_loss price on the current positions.
bracket order are coupled to the parent order. If the main (parent) order has already been executed or canceled, the bracket orders (stop-loss and take-profit) may no longer exist in an “open” state. Double-check that the order ID (257702521
) corresponds to the stop-loss leg and not the parent/main order.
Fetch all active orders using a GET
request.
url = “https://api.india.delta.exchange/v2/orders”
response = requests.get(url, headers=headers)
print(response.json())
Confirm if the stop-loss leg for the order ID 257702521
still exists as “open.”
In the response, look for order_type
and confirm that you’re passing the stop-loss order’s ID and not the main order’s ID.
If the stop-loss leg of the bracket order has been closed or expired, you can:
- Cancel the existing bracket orders.
- Re-create new stop-loss and take-profit legs
Then, place a new bracket order with the updated stop-loss:
Let me know if you encounter any further errors
The scenario is
- I placed a parent order as ‘limit_order’ and it got placed.
- Now I placed a bracket order, and that got coupled with the parent order, and now there are no ‘open orders’.
So, please let me know how to change the existing bracket order, which is already coupled with the parent order, like the way we change in the portal, through either dragging the stop-loss and taking the profit indication bar on the chart or through the portal option, which is there. Is there a way to again change the stop-loss since the order is not yet completed?
Please provide the resolution as soon as possible as the work is being stuck because of this issue.
The orders were filled immediately and converted into positions, leaving no open orders.
The PUT API for editing bracket orders works as expected since there are no open orders.
To create bracket orders for positions, use the POST API: Delta Exchange Api
This will generate actual order legs, which can be edited individually using the PUT API: Delta Exchange Api