Bracket and OCO Orders: Wetin Dem Mean
Bracket order na entry plus profit target and protective stop. Learn how OCO linkage dey work, wetin partial fill fit cause, and where the linkage dey sit.
A bracket order na one instruction wey send three orders wey get fixed relationship: entry, plus linked exit pair wey sit for both sides of am. The pair na OCO, short for one cancels the other. Profit-target limit dey above the entry price, while protective stop dey below am. Once one leg fill, e automatically cancel the other. Bracket order be like small state machine, and most surprises dey happen for the moments between one state and another.
Wetin be bracket order?
Imagine trader wey wan buy 200 shares near $50, close the position near $53 if trade work, and comot near $48.50 if e no work. If dem write am as separate tickets, na three orders plus manual work: cancel the stop immediately the target fill, otherwise trader fit sell 200 shares twice. Bracket package the same plan as one submission. The entry na ordinary market order or limit order. The two exits na im children: limit to close for the target, plus stop or stop limit order to close for the protective level.
The names fit vary. Bracket, attached order, OCO bracket, and OTOCO all describe this structure. OTOCO, one triggers a one-cancels-the-other, na the most direct name for the sequence: entry activate the pair, then the pair cancel itself until only one remain.
Wetin OCO mean for bracket order?
OCO na two resting orders wey get cancel link between dem. Both dey live inside the order book at the same time. Once one fill, the other one comot. If one fill partially, the other reduce by the quantity wey fill instead of cancelling completely. Na this reduction dey keep the position and protection matched share for share.
The full sequence for 200-share long bracket dey go like this.
- The entry dey work alone. Target and stop dey inside the broker system, but dem no be working orders yet. So if print pass the target price while entry never fill, nothing happen.
- Entry fill for 200 shares. Both children go live, each for 200 shares.
- Trading reach the stop price. The stop convert to live sell order and enter the book.
- Stop fill 120 shares before market move away. Target limit reduce from 200 to 80, matching the position wey remain.
- The remaining 80 shares fill for target later that session. The remaining 80 on the stop cancel, and the bracket close completely.
Partial fills on entry na where platforms differ pass. Some brokers activate the children immediately for the quantity wey fill, then increase dem as the rest of the entry completes. Others wait until entry fill completely. That one leave the position without protection during the interval. Broker semantics differ for ways wey no be cosmetic: whether children activate after partial entry fill, and whether editing one child break the cancel link on the other.
How far apart the two legs dey?
Both legs need dey outside the normal noise wey the name make on an ordinary day, but inside the distance wey e fit actually travel. Daily range na the first rough measure for this. The panel below read six household names across the trailing year: median high-to-low range as percentage of the open, beside median absolute move from open to close.
The exact SQL behind every number
SELECT
ticker,
round(quantileDeterministic(0.5)(
(toFloat64(high) - toFloat64(low)) / toFloat64(open) * 100,
toUInt32(date)), 2) AS median_range_pct,
round(quantileDeterministic(0.5)(
abs(toFloat64(close) - toFloat64(open)) / toFloat64(open) * 100,
toUInt32(date)), 2) AS median_open_to_close_pct
FROM global_markets.stocks_daily_aggs
WHERE ticker IN ('SPY', 'AAPL', 'MSFT', 'NVDA', 'KO', 'JNJ')
AND date >= today() - 370
AND date < today() - 2
GROUP BY ticker
ORDER BY median_range_pct DESCNVDA carry the widest typical session among the six at 2.72%, while SPY carry the narrowest at 0.86%. Notice how the second column dey far below the first for every row. A typical name travel much farther during a session than the amount e gain or lose from open to close, and both bracket legs dey inside that movement. Target and stop fit both reach their levels on the same ordinary day.
How often bracket leg dey get touched?
Distance from entry na the dial wey trader actually control. The next panel use three fixed years of SPY sessions and ask, for different distances from the opening print, wetin share of sessions reach that far down and wetin share reach that far up at some point during the day.
The exact SQL behind every number
SELECT
concat(toString(d.dist), '%') AS distance_from_open,
round(100 * countIf(
(toFloat64(a.open) - toFloat64(a.low)) / toFloat64(a.open) * 100 >= d.dist
) / count(), 1) AS reached_below_pct,
round(100 * countIf(
(toFloat64(a.high) - toFloat64(a.open)) / toFloat64(a.open) * 100 >= d.dist
) / count(), 1) AS reached_above_pct
FROM global_markets.stocks_daily_aggs AS a
CROSS JOIN
(
SELECT arrayJoin([0.25, 0.5, 1.0, 1.5, 2.0, 3.0]) AS dist
) AS d
WHERE a.ticker = 'SPY'
AND a.date >= '2023-08-01'
AND a.date < '2026-08-01'
GROUP BY d.dist
ORDER BY d.distAt quarter of one percent from the open, 62.3% of sessions trade that far down at some point, while 64.7% trade that far up. If distance widen to 3%, downside figure fall to 0.5%. Both curves dey decline together, and na the main tension for bracket sizing. Tight stop na stop wey ordinary days fit take out. Distant target na target wey mostly expire without fill.
Stop loss dey always fill for stop price?
No. Stop na instruction to send order once trigger price print. Plain stop send market order, and fill land wherever the book dey at that moment. Stop limit send limit order for price wey you set. E protect the price, but e accept the risk say order no fill at all. That trade-off na subject of stop order versus stop limit order.
Overnight gap na the clearest example. Protective stop fit rest while exchange close, and opening print fit land far past the trigger. Ten examples from AAPL across three and a half years:
The exact SQL behind every number
SELECT
formatDateTime(session_date, '%b %e, %Y') AS gap_label,
round((day_open / prev_close - 1) * 100, 2) AS overnight_gap_pct
FROM
(
SELECT
session_date,
day_open,
lagInFrame(day_close) OVER (
ORDER BY session_date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW
) AS prev_close
FROM
(
SELECT
date AS session_date,
toFloat64(any(open)) AS day_open,
toFloat64(any(close)) AS day_close
FROM global_markets.stocks_daily_aggs
WHERE ticker = 'AAPL'
AND date >= '2023-01-01'
AND date < '2026-07-01'
GROUP BY date
)
)
WHERE prev_close > 0
ORDER BY overnight_gap_pct ASC
LIMIT 10The biggest one measure -9.45% on Aug 5, 2024, while the tenth one for the list still measure -2.96%. Any protective stop wey rest inside those gaps convert at the opening print, no be for the trigger price. If you size bracket with intraday range alone, you leave that distance out of the model.
Where OCO link dey really live?
Almost never for the exchange. Broker order-management system dey hold the cancel link between the two children, or one layer further out inside trading platform wey run for your own machine. Exchange see two ordinary orders wey no connect to each other.
That location decide wetin go survive outage. Broker-side bracket continue to work when laptop close, because broker servers hold both legs and the cancel logic. Platform-side bracket, like the type some charting applications implement locally, need the application to dey run and connected. Some platforms hold simulated stop wey exist only for local memory until trigger price print. If you close laptop, that stop never reach the market.
The same question apply to your own code. Stop wey dey only inside running process leave nothing resting inside the book once process stop. Circuit breakers for trading bots explain the pattern for automated systems: assume say process go die for the worst possible moment, then ask wetin still dey work for broker.
Time in force apply to each leg
Every leg carry its own time in force setting. Day entry paired with GTC children na common but awkward combination: entry expire at close while children never activate, leaving bracket wey quietly do nothing the next morning. Reverse pairing leave protection wey expire at 4:00 p.m. ET on position wey trader carry overnight.
Outside regular hours, the book itself change character. The panel below group SPY minute bars by ET clock time across the full day and read two things for each half hour: average size of one-minute move, in basis points (one basis point na hundredth of one percent), plus median volume printed in one minute.
The exact SQL behind every number
SELECT
formatDateTime(
toStartOfInterval(toTimeZone(window_start, 'America/New_York'), INTERVAL 30 MINUTE),
'%H:%i') AS et_time,
round(avg(abs(toFloat64(close) - toFloat64(open)) / toFloat64(open) * 10000), 1) AS avg_move_bps,
round(quantileDeterministic(0.5)(toFloat64(volume), toUInt64(window_start)), 0) AS median_volume
FROM global_markets.delayed_stocks_minute_aggs
WHERE ticker = 'SPY'
AND window_start >= today() - 120
AND window_start < today() - 2
GROUP BY et_time
ORDER BY et_timeThe panel return 32 half-hour buckets, from 04:00 through 19:30 ET. Read am from left to right and the shape explain itself. Both series dey near their lowest level during premarket hours, rise sharply into the 09:30 open, and fall again after 16:00. GTC stop wey rest at 5 a.m. dey inside the thin part of that curve, and stop-market fill for book wey thin fit land far from the trigger.
FAQ
Wetin be the difference between bracket order and OCO order?
OCO na the pair itself: two resting orders wey get cancel link, where fill on one remove the other. Bracket na entry order wey get OCO pair attached, and the pair only go live after entry fill. Every bracket contain OCO. Plenty OCO pairs dey used on their own.
Bracket order still dey work if my computer off?
E depend on where the linkage dey. Broker-side bracket rest for broker servers and continue to work even when platform close. Platform-side or simulated bracket need the application to dey run and connected. Without am, the child orders fit never reach the market.
Wetin happen to the stop if profit target fill partially?
The stop reduce by the quantity wey fill instead of cancelling. If 200-share target fill 60 shares, stop drop to 140 shares, matching the position wey still open. Cancel only happen when the last part of the position close.
I fit use bracket order for premarket or after-hours trading?
Behaviour depend on broker, and many brokers only route bracket children during regular hours. Stop orders especially fit get rejected or held outside 9:30 a.m. to 4:00 p.m. ET for US equities. The time-in-force setting on each leg decide whether that leg qualify for extended session at all.
Exchanges know say my two orders dey linked?
No. For US equities, broker or platform hold the cancel link, while exchange receive two independent orders. Whichever system hold the link send the cancel message for the surviving leg after the other leg report its fill.
Every panel here come with the exact SQL underneath am. To measure the range and gap risk for any name wey you dey follow, ask the question in plain English on the Strasmore terminal.