Need help on Bracket Order placement via API

Group,

When placing Bracket order via code, I am using following endpoint and its request parameters. However, only main buy/sell order is placed and not TP or SL orders. I would greatly appreciate if anyone of you could help me with this.

Endpoint: https://live.ironbeamapi.com/v2/order/{accountId}/place

Request body:

{
 "accountId": "12345678",
 "exchSym": "XCME:MNQ.H26",
 "side": "BUY",
 "quantity": 1,
 "orderType": "LIMIT",
 "limitPrice": 25000,
 "stopLoss": 24950,
 "takeProfit": 25100,
 "duration": "0",
 "waitForOrderId": true
}

Cheers,
Adi

// single REST call – limit order with bracket offsets
nlohmann::json body = {
{“accountId”, username()},
{“exchSym”, symbol()},
{“side”, side},
{“quantity”, qty},
{“orderType”, “LIMIT”},
{“limitPrice”, entryPrice},
{“takeProfitOffset”, tpOffset},
{“stopLossOffset”, slOffset},
{“duration”, “1”},
{“waitForOrderId”, true}
};
ORD oid=…1523312 poid=…1523306 sym=XCME:MNQ.H26 st=0 sd=1 ot=3 – STOP child, poid set
ORD oid=…1523309 poid=…1523306 sym=XCME:MNQ.H26 st=0 sd=1 ot=2 – LIMIT child, poid set
The native bracket works perfectly. Ironbeam created two child orders automatically with poid correctly pointing to the parent 1523306. The single REST call with takeProfitOffset and stopLossOffset on a LIMIT order is the correct approach.

1 Like

I do not have an answer directly to your question, however I do have a suggestion. I treat my orders as triggers. Therefor, my logic is that the fill price may be different than the trigger price. Therefore in my approach, I want a take profit 20 points from my fill price and I want a stop 15 points from my fill price. For that bracket I use take profit offset and stop loss offset. I hope this helps. -Soup-