FIX.5.0SP2 Message
OrderCancelReplaceRequest [type 'G']
<OrdCxlRplcReq>
The order cancel/replace request is used to change the parameters of an existing order.
Do not use this message to cancel the remaining quantity of an outstanding order, use the Order Cancel Request message for this purpose.
Added FIX.2.7
Expand Components | Collapse Components
| Field or Component | Field Name | FIXML name | Req'd | Comments | Depr. |
Component | StandardHeader | BaseHeader | MsgType = G | |
37 | @OrdID | | Unique identifier of most recent order as assigned by sell-side (broker, exchange, ECN). | |
Component | Parties | Pty | | Insert here the set of "Parties" (firm identification) fields defined in "Common Components of Application Messages" | |
229 | @OrignDt | | | | ||
75 | @TrdDt | | | | ||
41 | @OrigID | | ClOrdID(11) of the previous non rejected order (NOT the initial order of the day) when canceling or replacing an order. Required when referring to orders that were electronically submitted over FIX or otherwise assigned a ClOrdID | | ||
11 | @ID | Unique identifier of replacement order as assigned by institution or by the intermediary with closest association with the investor.. Note that this identifier will be used in ClOrdID field of the Cancel Reject message if the replacement request is rejected. | | |||
526 | @ID2 | | | | ||
583 | @LnkID | | | | ||
66 | ListID | @ListID | | Required for List Orders | | |
586 | @OrigOrdModTm | | TransactTime of the last state change that occurred to the original order | | ||
1 | @Acct | | | | ||
660 | @AcctIDSrc | | | | ||
581 | @AcctTyp | | | | ||
589 | @DayBkngInst | | | | ||
590 | @BkngUnit | | | | ||
591 | @PreallocMeth | | | | ||
70 | @AllocID | | Used to assign an overall allocation id to the block of preallocations | |
Component | PreAllocGrp | PreAll | | Number of repeating groups for pre-trade allocation | |
63 | @SettlTyp | | For NDFs either SettlType or SettlDate should be specified. | | ||
64 | @SettlDt | | Takes precedence over SettlType value and conditionally required/omitted for specific SettlType values. For NDFs either SettlType or SettlDate should be specified. | | ||
544 | @CshMgn | | | | ||
635 | @ClrFeeInd | | | | ||
21 | @HandlInst | | | | ||
18 | @ExecInst | | Can contain multiple instructions, space delimited. Replacement order must be created with new parameters (i.e. original order values will not be brought forward to replacement order unless redefined within this message). | | ||
110 | MinQty | @MinQty | | | | |
1089 | @MtchInc | | | | ||
1090 | @MxPxLvls | | | |
Component | DisplayInstruction | DsplyInstr | | Insert here the set of "DisplayInstruction" fields defined in "common components of application messages" | |
111 | @MaxFloor | | | FIX.5.0 | ||
100 | @ExDest | | | | ||
1133 | @ExDestIDSrc | | | |
Component | TrdgSesGrp | TrdSes | | Specifies the number of repeating TradingSessionIDs | |
Component | Instrument | Instrmt | Insert here the set of "Instrument" (symbology) fields defined in "Common Components of Application Messages" Must match original order | |
Component | FinancingDetails | FinDetls | | Insert here the set of "FinancingDetails" (symbology) fields defined in "Common Components of Application Messages" Must match original order | |
Component | UndInstrmtGrp | Undly | | Number of underlyings | |
54 | Side | @Side | Should match original order's side, however, if bilaterally agreed to the following groups could potentially be interchanged: Buy and Buy Minus Sell, Sell Plus, Sell Short, and Sell Short Exempt Cross, Cross Short, and Cross Short Exempt | | ||
60 | @TxnTm | Time this order request was initiated/released by the trader or trading system. | | |||
854 | @QtyTyp | | | |
Component | OrderQtyData | OrdQty | Insert here the set of "OrderQtyData" fields defined in "Common Components of Application Messages" Note: OrderQty value should be the "Total Intended Order Quantity" (including the amount already executed for this chain of orders) | |
40 | @Typ | | | |||
423 | @PxTyp | | | | ||
44 | Price | @Px | | Required for limit OrdTypes. For F/X orders, should be the "all-in" rate (spot rate adjusted for forward points). Can be used to specify a limit price for a pegged order, previously indicated, etc. | | |
1092 | @PxPrtScp | | | | ||
99 | StopPx | @StopPx | | Required for OrdType = "Stop" or OrdType = "Stop limit". | |
Component | TriggeringInstruction | TrgrInstr | | Insert here the set of "TriggeringInstruction" fields defined in "common components of application messages" | |
Component | SpreadOrBenchmarkCurveData | SprdBnchmkCurve | | Insert here the set of "SpreadOrBenchmarkCurveData" (Fixed Income spread or benchmark curve) fields defined in "Common Components of Application Messages" | |
Component | YieldData | Yield | | Insert here the set of "YieldData" (yield-related) fields defined in "Common Components of Application Messages" | |
Component | PegInstructions | PegInstr | | Insert here the set of "PegInstruction" fields defined in "Common Components of Application Messages" | |
Component | DiscretionInstructions | DiscInstr | | Insert here the set of "DiscretionInstruction" fields defined in "Common Components of Application Messages" | |
847 | @TgtStrategy | | The target strategy of the order | |
Component | StrategyParametersGrp | StrtPrmGrp | | Strategy parameter block | |
848 | @TgtStrategyParameters | | For further specification of the TargetStrategy | FIX.5.0 | ||
849 | @ParticipationRt | | Mandatory for a TargetStrategy=Participate order and specifies the target particpation rate. For other order types optionally specifies a volume limit (i.e. do not be more than this percent of the market volume) | FIX.5.0 | ||
376 | @ComplianceID | | | | ||
377 | @SolFlag | | | | ||
15 | @Ccy | | Must match original order. | | ||
59 | @TmInForce | | Absence of this field indicates Day order | | ||
168 | @EfctvTm | | Can specify the time at which the order should be considered valid | | ||
432 | @ExpireDt | | Conditionally required if TimeInForce = GTD and ExpireTime is not specified. | | ||
126 | @ExpireTm | | Conditionally required if TimeInForce = GTD and ExpireDate is not specified. | | ||
427 | @GTBkngInst | | States whether executions are booked out or accumulated on a partially filled GT order | |
Component | CommissionData | Comm | | Insert here the set of "CommissionData" fields defined in "Common Components of Application Messages" | |
528 | @Cpcty | | | | ||
529 | @Rstctions | | | | ||
1091 | @PrTrdAnon | | | | ||
582 | @CustCpcty | | | | ||
121 | @ForexReq | | Indicates that broker is requested to execute a Forex accommodation trade in conjunction with the security trade. | | ||
120 | @SettlCcy | | Required if ForexReq=Y. Required for NDFs. | | ||
775 | @BkngTyp | | Method for booking out this order. Used when notifying a broker that an order to be settled by that broker is to be booked out as an OTC derivative (e.g. CFD or similar). Absence of this field implies regular booking. | | ||
58 | Text | @Txt | | | | |
354 | @EncTxtLen | | Must be set if EncodedText field is specified and must immediately precede it. | | ||
355 | @EncTxt | | Encoded (non-ASCII characters) representation of the Text field in the encoded format specified via the MessageEncoding field. | | ||
193 | @SettlDt2 | | Can be used with OrdType = "Forex - Swap" to specify the "value date" for the future portion of a F/X swap. | FIX.5.0 | ||
192 | @Qty2 | | Can be used with OrdType = "Forex - Swap" to specify the order quantity for the future portion of a F/X swap. | FIX.5.0 | ||
640 | Price2 | @Px2 | | Can be used with OrdType = "Forex - Swap" to specify the price for the future portion of a F/X swap. | FIX.5.0 | |
77 | @PosEfct | | For use in derivatives omnibus accounting | | ||
203 | @Covered | | For use with derivatives, such as options | | ||
210 | @MaxShow | | | FIX.5.0 | ||
114 | @LocReqd | | Required for short sell orders | | ||
480 | @CxllationRights | | For CIV - Optional | | ||
481 | @MnyLaunderingStat | | | | ||
513 | @RegistID | | Reference to Registration Instructions message for this Order. | | ||
494 | @Designation | | Supplementary registration information for this Order | | ||
1028 | @ManOrdInd | | | | ||
1029 | @CustDrctdOrd | | | | ||
1030 | @RcvdDptID | | | | ||
1031 | @CustOrdHdlInst | | | | ||
1032 | @OrdHndlInstSrc | | | |
Component | TrdRegTimestamps | TrdRegTS | | | |
Component | StandardTrailer | | | |
|
消息实现:
package cs.mina.codec.msg;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import cs.mina.exception.InValidDataException;
/*
*@author(huangxiaoping)
*@date 2013-11-29
*/
public class OrderCancelReplaceRequestMsg extends BaseMsg {
private Tag clOrdID=new Tag("11","String",true);
private Tag parties=new PartiesTag(false);
private Tag instrument=new InstrumentTag(true);
private Tag transactTime=new Tag("60","UTCTimestamp",true);
private Tag side=new Tag("54","char",true);
private Tag ordType=new Tag("40","char",true);
private Tag price=new Tag("44","Price",false);
private Tag orderQtyData=new OrderQtyDataTag(true);
private Tag timeInForce=new Tag("59","char",false);
private Tag positionEffect=new Tag("77","char",false);
private Tag orderRestrictions=new Tag("529","MultipleCharValue",false);
private Tag maxPriceLevels=new Tag("1090","int",false);
private Tag orderCapacity=new Tag("528","char",false);
private Tag text=new Tag("58","String",false);
private Tag execInst=new Tag("18","MultipleCharValue",false);
private Tag disclosureInstructionGrp=new DisclosureInstructionGrpTag(false);
private Tag orderID=new Tag("37","String",false);
private Tag origClOrdID=new Tag("41","String",false);
private Set<String> tagIdsSet=new HashSet<String>();
public OrderCancelReplaceRequestMsg(){
this.getHeadEntity().getMsgType().setTagValue("G");
tagIdsSet.add("11");
tagIdsSet.add("60");
tagIdsSet.add("54");
tagIdsSet.add("40");
tagIdsSet.add("44");
tagIdsSet.add("59");
tagIdsSet.add("77");
tagIdsSet.add("529");
tagIdsSet.add("1090");
tagIdsSet.add("528");
tagIdsSet.add("58");
tagIdsSet.add("18");
tagIdsSet.add("37");
tagIdsSet.add("41");
this.bodyEntity.getBodyTagList().add(clOrdID);
this.bodyEntity.getBodyTagList().add(parties);
this.bodyEntity.getBodyTagList().add(instrument);
this.bodyEntity.getBodyTagList().add(transactTime);
this.bodyEntity.getBodyTagList().add(side);
this.bodyEntity.getBodyTagList().add(ordType);
this.bodyEntity.getBodyTagList().add(price);
this.bodyEntity.getBodyTagList().add(orderQtyData);
this.bodyEntity.getBodyTagList().add(timeInForce);
this.bodyEntity.getBodyTagList().add(positionEffect);
this.bodyEntity.getBodyTagList().add(orderRestrictions);
this.bodyEntity.getBodyTagList().add(maxPriceLevels);
this.bodyEntity.getBodyTagList().add(orderCapacity);
this.bodyEntity.getBodyTagList().add(text);
this.bodyEntity.getBodyTagList().add(execInst);
this.bodyEntity.getBodyTagList().add(disclosureInstructionGrp);
this.bodyEntity.getBodyTagList().add(orderID);
this.bodyEntity.getBodyTagList().add(origClOrdID);
}
@Override
public void decodeBody() {
}
@Override
public void validate() {
this.headEntity.validate();
List<Tag> bodyTagList=this.bodyEntity.getBodyTagList();
for(int i=0;i<bodyTagList.size();i++){
bodyTagList.get(i).validate();
}
this.tailerEntity.validate();
if(side.getTagValue()!=null){
if(!MsgUtil.side.contains(side.getTagValue())){
throw new InValidDataException("side错误["+side.getTagId()+"="+side.getTagValue()+"]");
}
}
if(ordType.getTagValue()!=null){
if(!MsgUtil.ordType.contains(ordType.getTagValue())){
throw new InValidDataException("ordType错误["+ordType.getTagId()+"="+ordType.getTagValue()+"]");
}
}
if(timeInForce.getTagValue()!=null){
if(!MsgUtil.timeInForce.contains(timeInForce.getTagValue())){
throw new InValidDataException("timeInForce错误["+timeInForce.getTagId()+"="+timeInForce.getTagValue()+"]");
}
}
if(positionEffect.getTagValue()!=null){
if(!MsgUtil.positionEffect.contains(positionEffect.getTagValue())){
throw new InValidDataException("positionEffect错误["+positionEffect.getTagId()+"="+positionEffect.getTagValue()+"]");
}
}
if(orderCapacity.getTagValue()!=null){
if(!MsgUtil.orderCapacity.contains(orderCapacity.getTagValue())){
throw new InValidDataException("orderCapacity错误["+orderCapacity.getTagId()+"="+orderCapacity.getTagValue()+"]");
}
}
}
public Tag getClOrdID() {
return clOrdID;
}
public void setClOrdID(Tag clOrdID) {
this.clOrdID = clOrdID;
}
public Tag getParties() {
return parties;
}
public void setParties(Tag parties) {
this.parties = parties;
}
public Tag getInstrument() {
return instrument;
}
public void setInstrument(Tag instrument) {
this.instrument = instrument;
}
public Tag getTransactTime() {
return transactTime;
}
public void setTransactTime(Tag transactTime) {
this.transactTime = transactTime;
}
public Tag getSide() {
return side;
}
public void setSide(Tag side) {
this.side = side;
}
public Tag getOrdType() {
return ordType;
}
public void setOrdType(Tag ordType) {
this.ordType = ordType;
}
public Tag getPrice() {
return price;
}
public void setPrice(Tag price) {
this.price = price;
}
public Tag getOrderQtyData() {
return orderQtyData;
}
public void setOrderQtyData(Tag orderQtyData) {
this.orderQtyData = orderQtyData;
}
public Tag getTimeInForce() {
return timeInForce;
}
public void setTimeInForce(Tag timeInForce) {
this.timeInForce = timeInForce;
}
public Tag getPositionEffect() {
return positionEffect;
}
public void setPositionEffect(Tag positionEffect) {
this.positionEffect = positionEffect;
}
public Tag getOrderRestrictions() {
return orderRestrictions;
}
public void setOrderRestrictions(Tag orderRestrictions) {
this.orderRestrictions = orderRestrictions;
}
public Tag getMaxPriceLevels() {
return maxPriceLevels;
}
public void setMaxPriceLevels(Tag maxPriceLevels) {
this.maxPriceLevels = maxPriceLevels;
}
public Tag getOrderCapacity() {
return orderCapacity;
}
public void setOrderCapacity(Tag orderCapacity) {
this.orderCapacity = orderCapacity;
}
public Tag getText() {
return text;
}
public void setText(Tag text) {
this.text = text;
}
public Tag getExecInst() {
return execInst;
}
public void setExecInst(Tag execInst) {
this.execInst = execInst;
}
public Tag getDisclosureInstructionGrp() {
return disclosureInstructionGrp;
}
public void setDisclosureInstructionGrp(Tag disclosureInstructionGrp) {
this.disclosureInstructionGrp = disclosureInstructionGrp;
}
public Tag getOrderID() {
return orderID;
}
public void setOrderID(Tag orderID) {
this.orderID = orderID;
}
public Tag getOrigClOrdID() {
return origClOrdID;
}
public void setOrigClOrdID(Tag origClOrdID) {
this.origClOrdID = origClOrdID;
}
public Set<String> getTagIdsSet() {
return tagIdsSet;
}
public void setTagIdsSet(Set<String> tagIdsSet) {
this.tagIdsSet = tagIdsSet;
}
}
消息处理:略