Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
developers:fixapi:ocoorder [2025/09/12 01:50] – removed - external edit (Unknown date) 127.0.0.1 | developers:fixapi:ocoorder [2025/09/12 01:50] (current) – ↷ Page moved and renamed from developers:fixapi.ocoorder to developers:fixapi:ocoorder chad | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== OCO (One Cancels Other) Order ===== | ||
+ | |||
+ | An **OCO (One Cancels Other)** order consists of: | ||
+ | * A buy limit order below the market **and** a buy stop order above the market, **or** | ||
+ | * A sell limit order above the market **and** a sell stop order below the market. | ||
+ | |||
+ | When one order gets filled, the other is cancelled. | ||
+ | If one is partially filled, the volume on the other is reduced accordingly. | ||
+ | |||
+ | An OCO Order is submitted with the **New Order List** (Tag 35=E) message. | ||
+ | Following are the most relevant tags to build an OCO Order: | ||
+ | |||
+ | ^ Tag ^ Field ^ Description ^ | ||
+ | | 1385=1 | ContingencyType | Specifier of OCO order type | | ||
+ | | 44 | Price | Price of Limit component. Must be below last traded price for Buys and above for Sells. | | ||
+ | | 99 | Stop Price | Price of Stop component. Must be above last traded price for Buys and below for Sells. | | ||
+ | | 48 | SecurityID | Market for which the order is sent | | ||
+ | | 55 | Symbol | Contract for which the order is sent | | ||
+ | | 207 | SecurityExchange | Exchange for which the order is sent | | ||
+ | |||
+ | ---- | ||
+ | |||
+ | **Additional Notes** | ||
+ | * OCO orders can also be **GTC**, **StopLimit**, | ||
+ | * **Activation** is **not supported** with OCO orders. | ||
+ | * The Limit component can be either: | ||
+ | - Limit Order (**Tag 40=2**) | ||
+ | - Market-if-Touched (**Tag 40=J**) | ||
+ | * OCO orders are **not** intended for scenarios where both orders are placed very close together (e.g., consecutive prices or best bid/best offer). In active markets, both components may be filled. | ||
+ | * All OCO components must be for the **same account** and **same market**. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | **Sample** | ||
+ | |||
+ | In this example, a **buy OCO order** is submitted at: | ||
+ | * Limit Component Price = **157850** (Tag 44 = 157850) | ||
+ | * Stop Component Price = **157900** (Tag 99 = 157900) | ||
+ | |||
+ | The **Stop** component is filled, and the **Limit** component is subsequently cancelled. | ||
+ | |||
+ | OCO Order | ||
+ | < | ||
+ | >> 4/26/2013 9:17:40 AM | ||
+ | [FIXNEWORDERLIST] | ||
+ | [MsgSeqNum] 34 = 1871 | ||
+ | [SenderCompID] 49 = T4Example | ||
+ | [TargetCompID] 56 = T4 | ||
+ | [SenderSubID] 50 = Account1 | ||
+ | [SendingTime] 52 = 20130426-14: | ||
+ | [ListID] 66 = fnl-635025646605836934 | ||
+ | [ContingencyType] 1385 = 1 (OCO) | ||
+ | [ListExecInstType] 433 = 1 (IMMEDIATE) | ||
+ | [TotNoOrders] 68 = 2 | ||
+ | [ClOrdID] 11 = oco-1-635025646605836934 | ||
+ | [Account] 1 = Account1 | ||
+ | [Side] 54 = 1 (BUY) | ||
+ | [OrderQty] 38 = 1 | ||
+ | [SecurityID] 48 = CME_20130600_ESM3 | ||
+ | [Symbol] 55 = ES | ||
+ | [SecurityExchange] 207 = CME_Eq | ||
+ | [OrdType] 40 = 2 (LIMIT) | ||
+ | [Price] 44 = 157850 | ||
+ | [TimeInForce] 59 = 0 (DAY) | ||
+ | [HandlInst] 21 = 2 (AUTOMATED_EXECUTION_ORDER_PUBLIC_BROKER_INTERVENTION_OK) | ||
+ | [TransactTime] 60 = 20130426-14: | ||
+ | [ClOrdID] 11 = oco-2-635025646605836934 | ||
+ | [Account] 1 = Account1 | ||
+ | [Side] 54 = 1 (BUY) | ||
+ | [OrderQty] 38 = 1 | ||
+ | [SecurityID] 48 = CME_20130600_ESM3 | ||
+ | [Symbol] 55 = ES | ||
+ | [SecurityExchange] 207 = CME_Eq | ||
+ | [OrdType] 40 = 3 (STOP) | ||
+ | [StopPx] 99 = 157900 | ||
+ | [TimeInForce] 59 = 0 (DAY) | ||
+ | [HandlInst] 21 = 2 (AUTOMATED_EXECUTION_ORDER_PUBLIC_BROKER_INTERVENTION_OK) | ||
+ | [TransactTime] 60 = 20130426-14: | ||
+ | </ | ||
+ | OCO Order Response - Limit Component Working | ||
+ | < | ||
+ | << 4/26/2013 9:17:40 AM [fixexecutionreport] 34=130733|49=T4|56=T4Example|50=T4FIX|52=20130426-14: | ||
+ | [FIXEXECUTIONREPORT] | ||
+ | [MsgSeqNum] 34 = 130733 | ||
+ | [SenderCompID] 49 = T4 | ||
+ | [TargetCompID] 56 = T4Example | ||
+ | [SenderSubID] 50 = T4FIX | ||
+ | [SendingTime] 52 = 20130426-14: | ||
+ | [TargetLocationID] 143 = US,IL | ||
+ | [Account] 1 = Account1 | ||
+ | [ClOrdID] 11 = oco-1-635025646605836934 | ||
+ | [ListID] 66 = fnl-635025646605836934 | ||
+ | [ExecID] 17 = 48323.6446981231_ESM3.6350256466290500006.1.77A1CE19 | ||
+ | [ExecType] 150 = 0 (NEW) | ||
+ | [OrderID] 37 = 77A1CE19-9041-4620-80AB-40BFABB45048 | ||
+ | [OrdStatus] 39 = 0 (NEW) | ||
+ | [SecurityID] 48 = CME_20130600_ESM3 | ||
+ | [Symbol] 55 = ES | ||
+ | [SecurityExchange] 207 = CME_Eq | ||
+ | [MaturityMonthYear] 200 = 201306 | ||
+ | [TimeInForce] 59 = 0 (DAY) | ||
+ | [SecurityDesc] 107 = E-mini S&P 500 Jun13 | ||
+ | [Side] 54 = 1 (BUY) | ||
+ | [SecurityType] 167 = FUT (FUTURE) | ||
+ | [OrderQty] 38 = 1 | ||
+ | [OrdType] 40 = 2 (LIMIT) | ||
+ | [Price] 44 = 157850 | ||
+ | [TransactTime] 60 = 20130426-14: | ||
+ | [HandlInst] 21 = 1 (AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION) | ||
+ | [CustomerOrFirm] 204 = 0 (CUSTOMER) | ||
+ | [ContingencyType] 1385 = 1 (OCO) | ||
+ | </ | ||
+ | OCO Order Response - Stop Component Working | ||
+ | < | ||
+ | << 4/26/2013 9:17:40 AM [fixexecutionreport] 34=130735|49=T4|56=T4Example|50=T4FIX|52=20130426-14: | ||
+ | [FIXEXECUTIONREPORT] | ||
+ | [MsgSeqNum] 34 = 130735 | ||
+ | [SenderCompID] 49 = T4 | ||
+ | [TargetCompID] 56 = T4Example | ||
+ | [SenderSubID] 50 = T4FIX | ||
+ | [SendingTime] 52 = 20130426-14: | ||
+ | [TargetLocationID] 143 = US,IL | ||
+ | [Account] 1 = Account1 | ||
+ | [ClOrdID] 11 = oco-2-635025646605836934 | ||
+ | [ListID] 66 = fnl-635025646605836934 | ||
+ | [ExecID] 17 = 48324.6446981232_ESM3.6350256466290900006.1.824FCFDB | ||
+ | [ExecType] 150 = 0 (NEW) | ||
+ | [OrderID] 37 = 824FCFDB-D4D3-4207-B4A9-2FF07C1FE813 | ||
+ | [OrdStatus] 39 = 0 (NEW) | ||
+ | [SecurityID] 48 = CME_20130600_ESM3 | ||
+ | [Symbol] 55 = ES | ||
+ | [SecurityExchange] 207 = CME_Eq | ||
+ | [MaturityMonthYear] 200 = 201306 | ||
+ | [TimeInForce] 59 = 0 (DAY) | ||
+ | [SecurityDesc] 107 = E-mini S&P 500 Jun13 | ||
+ | [Side] 54 = 1 (BUY) | ||
+ | [SecurityType] 167 = FUT (FUTURE) | ||
+ | [OrderQty] 38 = 1 | ||
+ | [OrdType] 40 = 3 (STOP) | ||
+ | [StopPx] 99 = 157900 | ||
+ | [TransactTime] 60 = 20130426-14: | ||
+ | [HandlInst] 21 = 1 (AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION) | ||
+ | [CustomerOrFirm] 204 = 0 (CUSTOMER) | ||
+ | [ContingencyType] 1385 = 1 (OCO) | ||
+ | </ | ||
+ | OCO Order Response - Stop Component activated to Limit | ||
+ | < | ||
+ | << 4/26/2013 9:20:46 AM [fixexecutionreport] 34=131009|49=T4|56=T4Example|50=T4FIX|52=20130426-14: | ||
+ | [FIXEXECUTIONREPORT] | ||
+ | [MsgSeqNum] 34 = 131009 | ||
+ | [SenderCompID] 49 = T4 | ||
+ | [TargetCompID] 56 = T4Example | ||
+ | [SenderSubID] 50 = T4FIX | ||
+ | [SendingTime] 52 = 20130426-14: | ||
+ | [TargetLocationID] 143 = US,IL | ||
+ | [Account] 1 = Account1 | ||
+ | [ClOrdID] 11 = oco-2-635025646605836934 | ||
+ | [ListID] 66 = fnl-635025646605836934 | ||
+ | [ExecID] 17 = 48324.6446981232_ESM3.6350256484851300006.1.824FCFDB | ||
+ | [ExecType] 150 = 0 (NEW) | ||
+ | [OrderID] 37 = 824FCFDB-D4D3-4207-B4A9-2FF07C1FE813 | ||
+ | [OrdStatus] 39 = 0 (NEW) | ||
+ | [SecurityID] 48 = CME_20130600_ESM3 | ||
+ | [Symbol] 55 = ES | ||
+ | [SecurityExchange] 207 = CME_Eq | ||
+ | [MaturityMonthYear] 200 = 201306 | ||
+ | [TimeInForce] 59 = 0 (DAY) | ||
+ | [SecurityDesc] 107 = E-mini S&P 500 Jun13 | ||
+ | [Side] 54 = 1 (BUY) | ||
+ | [SecurityType] 167 = FUT (FUTURE) | ||
+ | [OrderQty] 38 = 1 | ||
+ | [OrdType] 40 = 2 (LIMIT) | ||
+ | [Price] 44 = 158200 | ||
+ | [TransactTime] 60 = 20130426-14: | ||
+ | [HandlInst] 21 = 1 (AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION) | ||
+ | [CustomerOrFirm] 204 = 0 (CUSTOMER) | ||
+ | [ContingencyType] 1385 = 1 (OCO) | ||
+ | </ | ||
+ | OCO Order Response - Stop Component Filled | ||
+ | < | ||
+ | << 4/26/2013 9:20:46 AM [fixexecutionreport] 34=131012|49=T4|56=T4Example|50=T4FIX|52=20130426-14: | ||
+ | [FIXEXECUTIONREPORT] | ||
+ | [MsgSeqNum] 34 = 131012 | ||
+ | [SenderCompID] 49 = T4 | ||
+ | [TargetCompID] 56 = T4Example | ||
+ | [SenderSubID] 50 = T4FIX | ||
+ | [SendingTime] 52 = 20130426-14: | ||
+ | [TargetLocationID] 143 = US,IL | ||
+ | [Account] 1 = Account1 | ||
+ | [ClOrdID] 11 = oco-2-635025646605836934 | ||
+ | [ExecID] 17 = 64229: | ||
+ | [ExecType] 150 = F | ||
+ | [OrderID] 37 = 824FCFDB-D4D3-4207-B4A9-2FF07C1FE813 | ||
+ | [OrdStatus] 39 = 2 (FILLED) | ||
+ | [SecurityID] 48 = CME_20130600_ESM3 | ||
+ | [Symbol] 55 = ES | ||
+ | [SecurityExchange] 207 = CME_Eq | ||
+ | [MaturityMonthYear] 200 = 201306 | ||
+ | [TimeInForce] 59 = 0 (DAY) | ||
+ | [SecurityDesc] 107 = E-mini S&P 500 Jun13 | ||
+ | [Side] 54 = 1 (BUY) | ||
+ | [SecurityType] 167 = FUT (FUTURE) | ||
+ | [OrderQty] 38 = 1 | ||
+ | [OrdType] 40 = 2 (LIMIT) | ||
+ | [Price] 44 = 158200 | ||
+ | [LastPx] 31 = 157900 | ||
+ | [LastShares] 32 = 1 | ||
+ | [CumQty] 14 = 1 | ||
+ | [LeavesQty] 151 = 0 | ||
+ | [TransactTime] 60 = 20130426-14: | ||
+ | [HandlInst] 21 = 1 (AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION) | ||
+ | [CustomerOrFirm] 204 = 0 (CUSTOMER) | ||
+ | [ContraTrader] 337 = TRADE | ||
+ | [ContraBroker] 375 = CME000A | ||
+ | [ContingencyType] 1385 = 1 (OCO) | ||
+ | </ | ||
+ | OCO Order Response - Limit Component pending cancel (Risk assessment success) | ||
+ | < | ||
+ | << 4/26/2013 9:20:46 AM [fixexecutionreport] 34=131013|49=T4|56=T4Example|50=T4FIX|52=20130426-14: | ||
+ | [FIXEXECUTIONREPORT] | ||
+ | [MsgSeqNum] 34 = 131013 | ||
+ | [SenderCompID] 49 = T4 | ||
+ | [TargetCompID] 56 = T4Example | ||
+ | [SenderSubID] 50 = T4FIX | ||
+ | [SendingTime] 52 = 20130426-14: | ||
+ | [TargetLocationID] 143 = US,IL | ||
+ | [Account] 1 = Account1 | ||
+ | [ClOrdID] 11 = oco-1-635025646605836934 | ||
+ | [ListID] 66 = fnl-635025646605836934 | ||
+ | [ExecID] 17 = 48323.6446981231_ESM3.63502564662905000014.1.77A1CE19 | ||
+ | [ExecType] 150 = 6 (PENDING_CANCEL) | ||
+ | [OrderID] 37 = 77A1CE19-9041-4620-80AB-40BFABB45048 | ||
+ | [OrdStatus] 39 = 6 (PENDING_CANCEL) | ||
+ | [SecurityID] 48 = CME_20130600_ESM3 | ||
+ | [Symbol] 55 = ES | ||
+ | [SecurityExchange] 207 = CME_Eq | ||
+ | [MaturityMonthYear] 200 = 201306 | ||
+ | [TimeInForce] 59 = 0 (DAY) | ||
+ | [SecurityDesc] 107 = E-mini S&P 500 Jun13 | ||
+ | [Side] 54 = 1 (BUY) | ||
+ | [SecurityType] 167 = FUT (FUTURE) | ||
+ | [OrderQty] 38 = 0 | ||
+ | [OrdType] 40 = 2 (LIMIT) | ||
+ | [Price] 44 = 157850 | ||
+ | [Text] 58 = OCO Pull: PullRiskSuccess. Pull passed risk management | ||
+ | [TransactTime] 60 = 20130426-14: | ||
+ | [HandlInst] 21 = 1 (AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION) | ||
+ | [CustomerOrFirm] 204 = 0 (CUSTOMER) | ||
+ | [ContingencyType] 1385 = 1 (OCO) | ||
+ | </ | ||
+ | OCO Order Response - Limit Component pending cancel (submitted to exchange) | ||
+ | < | ||
+ | << 4/26/2013 9:20:46 AM [fixexecutionreport] 34=131014|49=T4|56=T4Example|50=T4FIX|52=20130426-14: | ||
+ | [FIXEXECUTIONREPORT] | ||
+ | [MsgSeqNum] 34 = 131014 | ||
+ | [SenderCompID] 49 = T4 | ||
+ | [TargetCompID] 56 = T4Example | ||
+ | [SenderSubID] 50 = T4FIX | ||
+ | [SendingTime] 52 = 20130426-14: | ||
+ | [TargetLocationID] 143 = US,IL | ||
+ | [Account] 1 = Account1 | ||
+ | [ClOrdID] 11 = oco-1-635025646605836934 | ||
+ | [ListID] 66 = fnl-635025646605836934 | ||
+ | [ExecID] 17 = 48325.6446981231_ESM3.63502564662905000016.1.77A1CE19 | ||
+ | [ExecType] 150 = 6 (PENDING_CANCEL) | ||
+ | [OrderID] 37 = 77A1CE19-9041-4620-80AB-40BFABB45048 | ||
+ | [OrdStatus] 39 = 6 (PENDING_CANCEL) | ||
+ | [SecurityID] 48 = CME_20130600_ESM3 | ||
+ | [Symbol] 55 = ES | ||
+ | [SecurityExchange] 207 = CME_Eq | ||
+ | [MaturityMonthYear] 200 = 201306 | ||
+ | [TimeInForce] 59 = 0 (DAY) | ||
+ | [SecurityDesc] 107 = E-mini S&P 500 Jun13 | ||
+ | [Side] 54 = 1 (BUY) | ||
+ | [SecurityType] 167 = FUT (FUTURE) | ||
+ | [OrderQty] 38 = 0 | ||
+ | [OrdType] 40 = 2 (LIMIT) | ||
+ | [Price] 44 = 157850 | ||
+ | [Text] 58 = OCO Pull | ||
+ | [TransactTime] 60 = 20130426-14: | ||
+ | [HandlInst] 21 = 1 (AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION) | ||
+ | [CustomerOrFirm] 204 = 0 (CUSTOMER) | ||
+ | [ContingencyType] 1385 = 1 (OCO) | ||
+ | </ | ||
+ | OCO Order Response - Limit Component Cancelled | ||
+ | < | ||
+ | << 4/26/2013 9:20:46 AM [fixexecutionreport] 34=131015|49=T4|56=T4Example|50=T4FIX|52=20130426-14: | ||
+ | [FIXEXECUTIONREPORT] | ||
+ | [MsgSeqNum] 34 = 131015 | ||
+ | [SenderCompID] 49 = T4 | ||
+ | [TargetCompID] 56 = T4Example | ||
+ | [SenderSubID] 50 = T4FIX | ||
+ | [SendingTime] 52 = 20130426-14: | ||
+ | [TargetLocationID] 143 = US,IL | ||
+ | [Account] 1 = Account1 | ||
+ | [ClOrdID] 11 = oco-1-635025646605836934 | ||
+ | [ListID] 66 = fnl-635025646605836934 | ||
+ | [ExecID] 17 = 48325.6446981231_ESM3.63502564849076000018.2.77A1CE19 | ||
+ | [ExecType] 150 = 4 (CANCELED) | ||
+ | [OrderID] 37 = 77A1CE19-9041-4620-80AB-40BFABB45048 | ||
+ | [OrdStatus] 39 = 4 (CANCELED) | ||
+ | [SecurityID] 48 = CME_20130600_ESM3 | ||
+ | [Symbol] 55 = ES | ||
+ | [SecurityExchange] 207 = CME_Eq | ||
+ | [MaturityMonthYear] 200 = 201306 | ||
+ | [TimeInForce] 59 = 0 (DAY) | ||
+ | [SecurityDesc] 107 = E-mini S&P 500 Jun13 | ||
+ | [Side] 54 = 1 (BUY) | ||
+ | [SecurityType] 167 = FUT (FUTURE) | ||
+ | [OrderQty] 38 = 0 | ||
+ | [OrdType] 40 = 2 (LIMIT) | ||
+ | [Price] 44 = 157850 | ||
+ | [TransactTime] 60 = 20130426-14: | ||
+ | [HandlInst] 21 = 1 (AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION) | ||
+ | [CustomerOrFirm] 204 = 0 (CUSTOMER) | ||
+ | [ContingencyType] 1385 = 1 (OCO) | ||
+ | </ | ||
+ | Further details on the tags used for this order type are described in the dictionary of the New Order List message. | ||
+ | |||
+ | [[developers: | ||