Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
developers:fixapi:cancelreplacerequest [2025/09/12 01:34] – ↷ Page moved and renamed from developers:fixapi.cancelreplacerequest to developers:fixapi:cancelreplacerequest chad | developers:fixapi:cancelreplacerequest [2025/09/12 02:04] (current) – chad | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Order Cancel-Replace Request | + | ====== ORDER CANCEL/ |
- | Amending Working Orders | + | The Order Cancel/ |
- | ----------------------- | + | |
- | The **Order Cancel-Replace Request** message (MsgType=G) is used by the T4 FIX API to electronically amend (revise) the replaceable fields of working orders. This message is used for all CTS strategy types including outright futures, futures options, spreads, | + | ===== Prerequisites ===== |
+ | | ||
+ | | ||
+ | * New unique ClOrdID required (12-20 characters) | ||
- | The instrument for which the replace applies is identified with the following tags: | + | ===== Replaceable Fields ===== |
- | * **Tag 48** = SecurityID | + | ^ Field ^ Tag ^ Applicable Order Types ^ |
- | * **Tag 55** = Symbol | + | | OrderQty | 38 | All orders | |
- | * **Tag 207** = SecurityExchange | + | | Price | 44 | Limit, Stop Limit, Market If Touched | |
- | * **Tag 167** = SecurityType | + | | StopPx | 99 | Stop, Stop Limit | |
+ | | MaxShow | 210 | Iceberg (if exchange supported) | | ||
+ | | TrailingDelta | 10100 | Trailing Stop | | ||
+ | | ActivationValue | 10103 | Activation orders | | ||
- | Options orders must also include: | + | ===== Special Operations ===== |
- | * **Tag 202** = Strike Price | + | **Queue Order Activation:** |
- | * **Tag 201** = PutOrCall | + | |
- | All cancel-replaces must be uniquely identified with a verbose | + | **Order |
+ | * **API-submitted orders:** Use OrigClOrdID | ||
+ | * **Frontend-submitted orders:** Use OrderID (37) and set OrigClOrdID = OrderID | ||
+ | * **Recommended: | ||
- | Replaceable Fields | + | ===== Message Specification ===== |
- | ------------------ | + | |
- | The fields that can be replaced: | + | **Message Direction:** Client → T4 |
- | ^ Field Name ^ Tag Number | + | ^ Tag ^ Field Name ^ Type ^ Req' |
- | | Order Quantity | + | | | **Message Header** | | Y | MsgType = G | |
- | | Price | + | | 1 | Account | String | Y | Account code | |
- | | Stop Price | + | | 11 | ClOrdID | String | Y | New unique ID for this replace (12-20 chars) | |
- | | MaxShow | + | | 41 | OrigClOrdID | String | Y | Original ClOrdID of target order | |
- | | Trailing Delta | 10100 | For Trailing | + | | 37 | OrderID | String | Y | T4-generated ID of target order | |
- | | Activation Value | 10103 | For Activation | + | | 48 | SecurityID | String | Y | T4 Market ID | |
+ | | 55 | Symbol | String | Y | T4 Contract ID | | ||
+ | | 207 | SecurityExchange | String | Y | T4 Exchange ID | | ||
+ | | 167 | SecurityType | String | Y | FUT, OPT, STK, SYN, BIN | | ||
+ | | 201 | PutOrCall | Int | C | Options only. 0=Put, 1=Call | | ||
+ | | 202 | StrikePrice | Float | C | Options only. Strike price | | ||
+ | | 54 | Side | Char | Y | 0=None, 1=Buy, 2=Sell | | ||
+ | | 38 | OrderQty | Int | Y | Total quantity (includes filled portions) | ||
+ | | 40 | OrdType | ||
+ | | 44 | Price | Float | C | Required for Limit, Stop Limit, MIT | | ||
+ | | 99 | StopPx | Float | C | Required for Stop, Stop Limit | | ||
+ | | 59 | TimeInForce | Char | Y | 0=Day, 1=GTC, 3=IOC, 4=FOK | | ||
+ | | 60 | TransactTime | UTCTimestamp | Y | Replace request time | | ||
+ | | 21 | HandlInst | Char | O | 1=Automated private, 2=Automated public, 3=Manual | | ||
+ | | 210 | MaxShow | Int | O | Iceberg visible quantity | ||
+ | | 77 | OpenClose | Char | O | O=Open, C=Close | | ||
+ | | 200 | MaturityMonthYear | String | O | Format: YYYYMM | | ||
+ | | 204 | CustomerOrFirm | Int | O | 0=Customer, 1=Firm | | ||
+ | | 58 | Text | String | O | Free form text | | ||
+ | | 107 | SecurityDesc | String | O | Security description | | ||
+ | | 1028 | ManualOrderIndicator | Boolean | O | Y=Manual, N=Automated | | ||
+ | | 10100 | TrailingDelta | Float | O | Trailing | ||
+ | | 10103 | ActivationValue | String | O | Activation | ||
+ | | | **Message Trailer** | | Y | | | ||
- | Identifying the Order to be Replaced | + | ===== Sample Messages ===== |
- | ------------------------------------ | + | |
- | Working orders can be identified by: | + | **Note: |
- | + | ||
- | * **OrigClOrdId (Tag 41)** – Client-side identifier of the target working order | + | |
- | * **OrderId (Tag 37)** – T4 FIX API-generated unique identifier | + | |
- | + | ||
- | > Note: Orders with previous rejections can be replaced using either OrderId or the ClOrdId of the rejection. | + | |
- | > Orders submitted outside the T4 FIX API (e.g., CTS T4 Front-End) must use **OrderId | + | |
- | > It is recommended to specify both OrigClOrdId and OrderId | + | |
- | + | ||
- | Activating Queued Orders | + | |
- | ------------------------ | + | |
- | + | ||
- | For **Queue Orders**, the cancel-replace message is also used to activate held or suspended orders. | + | |
- | + | ||
- | * **Activation Value (Tag 10102)** must be set to **-1** | + | |
- | + | ||
- | Important Considerations | + | |
- | ------------------------ | + | |
- | + | ||
- | * Malformed replace orders will be rejected with a **FIX Session Reject**. | + | |
- | * Application-level rejections are manifested with **Cancel Reject** | + | |
- | * All order routing must be preceded by a successful subscription to the account. See **Collateral Inquiry** for subscription instructions. | + | |
- | * Contingent orders like OCO and AutoOCO can only be replaced one component at a time, identified by **OrigClOrdID | + | |
- | + | ||
- | Message Dictionary | + | |
- | ------------------ | + | |
- | + | ||
- | ^ Tag ^ Field Name ^ Req'd ^ Comments ^ | + | |
- | | Standard Header | Y | MsgType = G | | + | |
- | | 1 | Account | Y | Account (code) for which the order is submitted | | + | |
- | | 11 | ClOrdID | Y | Client-Side identifier for this replace order. Max characters: 20 | | + | |
- | | 41 | OrigClOrdID | Y | Client-Side ClOrdID of the target working order. Max characters: 20 | | + | |
- | | 37 | OrderId | Y | T4 API-generated unique identifier for the target working order | | + | |
- | | 48 | SecurityID | Y | T4 Market ID | | + | |
- | | 55 | Symbol | Y | T4 Contract ID | | + | |
- | | 207 | SecurityExchange | Y | T4 Exchange ID | | + | |
- | | 167 | SecurityType | Y | Instrument type (FUT, OPT, STK, SYN, BIN) | | + | |
- | | 201 | PutOrCall | N | For Options: 0=Put, 1=Call | | + | |
- | | 202 | StrikePrice | N | For Options: Strike Price | | + | |
- | | 54 | Side | Y | 0=None, 1=Buy, 2=Sell | | + | |
- | | 38 | OrderQty | Y | Number of contracts to replace. For partially filled orders, reflects original Quantity | | + | |
- | | 210 | MaxShow | N | Max visible quantity for Icebergs | | + | |
- | | 40 | OrdType | Y | Order Type. Some types cannot be replaced (Flatten, Hit, Market). Valid values: 1=Market, 2=Limit, 3=Stop, 4=Stop-Limit, | + | |
- | | 44 | Price | N | Required for Limit, Stop-Limit, and Market-if-Touched. Auto OCO: relative to Trigger Price (Tag 10101). Negative allowed | | + | |
- | | 99 | StopPx | N | Required for Stops and Stop-Limit. Auto OCO: relative to Trigger Price (Tag 10101). Negative allowed | | + | |
- | | 59 | TimeInForce | Y | 0=Day, 1=GTC, 3=IOC, 4=FOK | | + | |
- | | 200 | MaturityMonthYear | N | Format YYYYMM | | + | |
- | | 60 | TransactTime | Y | Time order was requested (UTC) | | + | |
- | | 21 | HandlInst | N | 1=Automated private, 2=Automated public, 3=Manual | | + | |
- | | 77 | OpenClose | N | O=Open, C=Close | | + | |
- | | 58 | Text | N | Free form text | | + | |
- | | 107 | SecurityDesc | N | Description of SecurityID (Tag 48) | | + | |
- | | 1028 | ManualOrderIndicator | N | Y=Manual, N=Automated | | + | |
- | | 10100 | TrailingDelta | N | Trailing Stop amount | | + | |
- | | 10103 | ActivationValue | N | Conditions for ActivationType; | + | |
- | | Standard Trailer | Y | | | + | |
- | + | ||
- | + | ||
- | Sample Messages | + | |
- | + | ||
- | Replacing a Working Order entered through the T4 FIX API | + | |
+ | **Replace API-Submitted Order:** | ||
< | < | ||
- | [FIXCANCELREPLACE] 34=121|49=T4Example|56=T4|50=TraderName|52=20121212-16: | + | 8=FIX.4.2|9=250|35=G|49=T4Example|56=T4|50=TraderName|52=20121212-16: |
- | + | 1=Account1|11=fr-634909058174264921|41=fn-634909058088464770| | |
- | [MsgSeqNum] 34 = 121 | + | 37=C8D64D65-7FCD-472B-9A55-3E77F404F1BE|48=CME_20121200_ESZ2|55=ES|207=CME_Eq| |
- | [SenderCompID] 49 = T4Example | + | 167=FUT|54=1|38=1|40=2|44=143025|59=0|21=1|60=20121212-16: |
- | [TargetCompID] 56 = T4 | + | |
- | [SenderSubID] 50 = TraderName | + | |
- | [SendingTime] 52 = 20121212-16: | + | |
- | [Account] 1 = Account1 | + | |
- | [ClOrdID] 11 = fr-634909058174264921 | + | |
- | [OrigClOrdID] 41 = fn-634909058088464770 | + | |
- | [OrderID] 37 = C8D64D65-7FCD-472B-9A55-3E77F404F1BE | + | |
- | [SecurityID] 48 = CME_20121200_ESZ2 | + | |
- | [Symbol] 55 = ES | + | |
- | [SecurityExchange] 207 = CME_Eq | + | |
- | [Side] 54 = 1 (BUY) | + | |
- | [OrderQty] 38 = 1 | + | |
- | [OrdType] 40 = 2 (LIMIT) | + | |
- | [Price] 44 = 143025 | + | |
- | [TimeInForce] 59 = 0 (DAY) | + | |
- | [SecurityType] 167 = FUT (FUTURE) | + | |
- | [HandlInst] 21 = 1 (AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION) | + | |
- | [TransactTime] 60 = 20121212-16: | + | |
- | [CustomerOrFirm] 204 = 0 (CUSTOMER) | + | |
- | + | ||
- | [fixexecutionreport] 34=5702|49=T4|56=T4Example|50=T4FIX|52=20121212-16: | + | |
- | + | ||
- | [MsgSeqNum] 34 = 5702 | + | |
- | [SenderCompID] 49 = T4 | + | |
- | [TargetCompID] 56 = T4Example | + | |
- | [SenderSubID] 50 = T4FIX | + | |
- | [SendingTime] 52 = 20121212-16: | + | |
- | [TargetLocationID] 143 = US,IL | + | |
- | [Account] 1 = Account1 | + | |
- | [ClOrdID] 11 = fr-634909058174264921 | + | |
- | [OrigClOrdID] 41 = fn-634909058088464770 | + | |
- | [ExecID] 17 = 48187.71332576498_ESZ2.63490905838440000012.1.C8D64D65 | + | |
- | [ExecType] 150 = 5 (REPLACE) | + | |
- | [OrderID] 37 = C8D64D65-7FCD-472B-9A55-3E77F404F1BE | + | |
- | [OrdStatus] 39 = 5 (REPLACED) | + | |
- | [SecurityID] 48 = CME_20121200_ESZ2 | + | |
- | [Symbol] 55 = ES | + | |
- | [SecurityExchange] 207 = CME_Eq | + | |
- | [MaturityMonthYear] 200 = 201212 | + | |
- | [TimeInForce] 59 = 0 (DAY) | + | |
- | [SecurityDesc] 107 = E-mini S&P 500 Dec12 | + | |
- | [Side] 54 = 1 (BUY) | + | |
- | [SecurityType] 167 = FUT (FUTURE) | + | |
- | [OrderQty] 38 = 1 | + | |
- | [OrdType] 40 = 2 (LIMIT) | + | |
- | [Price] 44 = 143025 | + | |
- | [TransactTime] 60 = 20121212-16: | + | |
</ | </ | ||
- | Replacing a Working Order entered through the CTS Front-end | + | **Replace Frontend-Submitted Order:** |
< | < | ||
- | + | 8=FIX.4.2|9=250|35=G|49=T4Example|56=T4|50=TraderName|52=20121212-18: | |
- | [FIXCANCELREPLACE] 34=6|49=T4Example|56=T4|50=TraderName|52=20121212-18: | + | 1=Account1|11=fr-634909107579297721|41=FA657BC9-A1D2-4644-B558-A1155C731DA4| |
- | + | 37=FA657BC9-A1D2-4644-B558-A1155C731DA4|48=CME_20121200_ESZ2|55=ES|207=CME_Eq| | |
- | [MsgSeqNum] 34 = 6 | + | 167=FUT|54=1|38=1|40=2|44=143075|59=0|21=1|60=20121212-18: |
- | [SenderCompID] 49 = T4Example | + | |
- | [TargetCompID] 56 = T4 | + | |
- | [SenderSubID] 50 = TraderName | + | |
- | [SendingTime] 52 = 20121212-18: | + | |
- | [Account] 1 = Account1 | + | |
- | [ClOrdID] 11 = fr-634909107579297721 | + | |
- | [OrigClOrdID] 41 = FA657BC9-A1D2-4644-B558-A1155C731DA4 | + | |
- | [OrderID] 37 = FA657BC9-A1D2-4644-B558-A1155C731DA4 | + | |
- | [SecurityID] 48 = CME_20121200_ESZ2 | + | |
- | [Symbol] 55 = ES | + | |
- | [SecurityExchange] 207 = CME_Eq | + | |
- | [Side] 54 = 1 (BUY) | + | |
- | [OrderQty] 38 = 1 | + | |
- | [OrdType] 40 = 2 (LIMIT) | + | |
- | [Price] 44 = 143075 | + | |
- | [TimeInForce] 59 = 0 (DAY) | + | |
- | [SecurityType] 167 = FUT (FUTURE) | + | |
- | [HandlInst] 21 = 1 (AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION) | + | |
- | [TransactTime] 60 = 20121212-18: | + | |
- | [CustomerOrFirm] 204 = 0 (CUSTOMER) | + | |
- | + | ||
- | [fixexecutionreport] 34=236|49=T4|56=T4Example|50=T4FIX|52=20121212-18: | + | |
- | + | ||
- | [MsgSeqNum] 34 = 236 | + | |
- | [SenderCompID] 49 = T4 | + | |
- | [TargetCompID] 56 = T4Example | + | |
- | [SenderSubID] 50 = T4FIX | + | |
- | [SendingTime] 52 = 20121212-18: | + | |
- | [TargetLocationID] 143 = US,IL | + | |
- | [Account] 1 = Account1 | + | |
- | [ClOrdID] 11 = fr-634909107579297721 | + | |
- | [ExecID] 17 = 48199.71332626389_ESZ2.63490910779020000012.1.FA657BC9 | + | |
- | [ExecType] 150 = 5 (REPLACE) | + | |
- | [OrderID] 37 = FA657BC9-A1D2-4644-B558-A1155C731DA4 | + | |
- | [OrdStatus] 39 = 5 (REPLACED) | + | |
- | [SecurityID] 48 = CME_20121200_ESZ2 | + | |
- | [Symbol] 55 = ES | + | |
- | [SecurityExchange] 207 = CME_Eq | + | |
- | [MaturityMonthYear] 200 = 201212 | + | |
- | [TimeInForce] 59 = 0 (DAY) | + | |
- | [SecurityDesc] 107 = E-mini S&P 500 Dec12 | + | |
- | [Side] 54 = 1 (BUY) | + | |
- | [SecurityType] 167 = FUT (FUTURE) | + | |
- | [OrderQty] 38 = 1 | + | |
- | [OrdType] 40 = 2 (LIMIT) | + | |
- | [Price] 44 = 143075 | + | |
- | [TransactTime] 60 = 20121212-18: | + | |
</ | </ | ||
- | [[developers: | + | ===== Notes ===== |
+ | * Malformed messages rejected with Session Reject (35=3) | ||
+ | * Application errors returned via Order Cancel Reject (35=9) | ||
+ | * Market, Flatten, and Hit orders cannot be replaced | ||
+ | * OCO/AutoOCO orders must be replaced one component at a time | ||
+ | * Previously rejected orders can be replaced using ClOrdID from rejection |