- Solve real problems with our hands-on interface
- Progress from basic puts and calls to advanced strategies
Posted June 3, 2021 at 9:42 am
To help limit loss and lock in a profit you can bracket an order with additional opposite-side orders.
A BUY order is bracketed by a high-side sell limit and a low-side sell stop order. A SELL order is bracketed by a high-side buy stop order and a low side buy limit order.
The endpoint /iserver/account/{accounted}/orders can be used to pass order request info in an Array to include the parent and child order(s).
A single customer order Id (cOID) is sent with the parent and the same value is specified in parentId for the child order(s).
Please be sure to authenticate first in order to resolve the below URLs.
For authentication details, visit https://interactivebrokers.github.io/cpwebapi/index.html#login
POST
https://localhost:5000/v1/api/iserver/account/{accountId}/orders
Request Body:
Array () [
]
Response:
Array (){
Please be sure to authenticate first in order to resolve the below URLs.
For authentication details, visit https://interactivebrokers.github.io/cpwebapi/index.html#login
Request:
POST
https://localhost:5000/v1/api/iserver/account/DU***14/orders
Request Body:
{
“orders”: [
{
“acctId”: “DU***14”,
“conid”: “265598”,
“cOID”: “66807300”,
“orderType”: “LMT”,
“listingExchange”: “SMART”,
“outsideRTH”: true,
“price”: 115.5,
“side”: “BUY”,
“ticker”: “AAPL”,
“tif”: “DAY”,
“referrer”: “ParentOrder”,
“quantity”: 50,
“useAdaptive”: false,
“isClose”: false
},
{
“acctId”: “DU***14”,
“conid”: “265598”,
“orderType”: “LMT”,
“listingExchange”: “SMART”,
“outsideRTH”: true,
“price”: 125.5,
“side”: “SELL”,
“ticker”: “AAPL”,
“tif”: “DAY”,
“referrer”: “ProfitTakerOrder”,
“quantity”: 50,
“useAdaptive”: false,
“isClose”: false,
“parentId”: “66807300”,
},
{
“acctId”: “DU***14”,
“conid”: “265598”,
“orderType”: “STP”,
“listingExchange”: “SMART”,
“outsideRTH”: false,
“price”: 110.5,
“side”: “SELL”,
“ticker”: “AAPL”,
“tif”: “DAY”,
“referrer”: “StopLossOrder”,
“quantity”: 50,
“useAdaptive”: false,
“isClose”: false,
“parentId”: “66807300”,
}
]
}
Response:
[
{
“order_id”: “1763237133”,
“order_status”: “Submitted”,
“local_order_id”: “66807300”
},
{
“order_id”: “1763237135”,
“order_status”: “PreSubmitted”,
“parent_order_id”: “1763237133”
}
]
If you have any further questions or issues creating a bracket order, please reach out to the API Group, ref: https://www.interactivebrokers.com/en/index.php?f=47047.
Visit the IBKR API Center for Downloads, Resources, and Technical Details:
https://www.interactivebrokers.com/en/trading/ib-api.php.
See the previous installments in this series:
The analysis in this material is provided for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IBKR to buy, sell or hold such investments. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.
The views and opinions expressed herein are those of the author and do not necessarily reflect the views of Interactive Brokers, its affiliates, or its employees.
The order types available through Interactive Brokers LLC's Trader Workstation are designed to help you limit your loss and/or lock in a profit. Market conditions and other factors may affect execution. In general, orders guarantee a fill or guarantee a price, but not both. In extreme market conditions, an order may either be executed at a different price than anticipated or may not be filled in the marketplace.
Join The Conversation
For specific platform feedback and suggestions, please submit it directly to our team using these instructions.
If you have an account-specific question or concern, please reach out to Client Services.
We encourage you to look through our FAQs before posting. Your question may already be covered!