fix协议介绍18-取消查询订单(QuoteCancel)

时间:2023-01-01 14:01:10



FIX.5.0SP2 Message

QuoteCancel [type 'Z']

<QuotCxl>



The Quote Cancel message is used by an originator of quotes to cancel quotes.



The Quote Cancel message supports cancellation of:



• All quotes



• Quotes for a specific symbol or security ID



• All quotes for a security type



• All quotes for an underlying




Added  FIX.4.2

Expand Components | Collapse Components

 

Field or Component

Field Name

FIXML name

Req'd

Comments

Depr.


Component

StandardHeader

BaseHeader


MsgType = Z

 


​131​

​QuoteReqID​

@ReqID

 

Required when quote is in response to a Quote Request message

 


​117​

​QuoteID​

@QID

 

Conditionally required when QuoteCancelType(298) = 5 (cancel quote specified in QuoteID). Maps to QuoteID(117) of a single Quote(MsgType=S) or QuoteEntryID(299) of a MassQuote(MsgType=i).

 


​1166​

​QuoteMsgID​

@QtMsgID

 

Optionally used to supply a message identifier for a quote cancel.

 


​298​

​QuoteCancelType​

@CxlTyp


Identifies the type of Quote Cancel request.

 


​537​

​QuoteType​

@Typ

 

Conditional Required when QuoteCancelType(298)=6[Cancel by QuoteType]

 


​301​

​QuoteResponseLevel​

@RspLvl

 

Level of Response requested from receiver of quote messages.

 


Component

Parties

Pty

 

Insert here the set of "Parties" (firm identification) fields defined in "Common Components of Application Messages"

 


Component

TargetParties

TgtPty

 

Can be used to specify the parties to whom the Quote Cancel should be applied.

 


​1​

​Account​

@Acct

 

 

 


​660​

​AcctIDSource​

@AcctIDSrc

 

 

 


​581​

​AccountType​

@AcctTyp

 

Type of account associated with the order (Origin)

 


​336​

​TradingSessionID​

@SesID

 

 

 


​625​

​TradingSessionSubID​

@SesSub

 

 

 


Component

QuotCxlEntriesGrp

QuotCxlEntry

 

The number of securities (instruments) whose quotes are to be canceled

Not required when cancelling all quotes.

 


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-12-2
*/
public class QuoteCancelMsg extends BaseMsg {
private Tag quoteMsgID = new Tag("1166", "String", false);
private Tag quoteCancelType = new Tag("298", "int", true);
private Tag parties = new PartiesTag(false);
private Tag quotCxlEntriesGrp = new QuotCxlEntriesGrpTag(false);

private Set<String> tagIdsSet = new HashSet<String>();

public QuoteCancelMsg() {
this.getHeadEntity().getMsgType().setTagValue("Z");
tagIdsSet.add("1166");
tagIdsSet.add("298");
this.bodyEntity.getBodyTagList().add(quoteMsgID);
this.bodyEntity.getBodyTagList().add(quoteCancelType);
this.bodyEntity.getBodyTagList().add(parties);
this.bodyEntity.getBodyTagList().add(quotCxlEntriesGrp);
}

@Override
public void decodeBody() {
Set<String> already = new HashSet<String>();
String input = this.body;
while (input.length() != 0) {
String firstTagId = input.substring(0, input.indexOf("="));
if (firstTagId.equals("453")) {
input = this.getParties().decode(input, already);
} else if (firstTagId.equals("295")) {
input = this.quotCxlEntriesGrp.decode(input, already);
} else {
List<Tag> tagList = this.bodyEntity.getBodyTagList();
boolean exist = false;
for (int j = 0; j < tagList.size(); j++) {
Tag tag = tagList.get(j);
if (tag.getTagId().equals(firstTagId)) {
input = tag.decode(input, already);
exist = true;
break;
}
}
if (!exist) {
throw new InValidDataException(firstTagId + "不在消息字段中");
}
}

}
}

@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 (quoteCancelType.getTagValue() != null) {
if (!(Integer.parseInt(quoteCancelType.getTagValue()) >= 1 && Integer
.parseInt(quoteCancelType.getTagValue()) <= 8)) {
throw new InValidDataException("quoteCancelType错误["
+ quoteCancelType.getTagId() + "="
+ quoteCancelType.getTagValue() + "]");
}
}
}

public Tag getQuoteMsgID() {
return quoteMsgID;
}

public void setQuoteMsgID(Tag quoteMsgID) {
this.quoteMsgID = quoteMsgID;
}

public Tag getQuoteCancelType() {
return quoteCancelType;
}

public void setQuoteCancelType(Tag quoteCancelType) {
this.quoteCancelType = quoteCancelType;
}

public Tag getParties() {
return parties;
}

public void setParties(Tag parties) {
this.parties = parties;
}

public Tag getQuotCxlEntriesGrp() {
return quotCxlEntriesGrp;
}

public void setQuotCxlEntriesGrp(Tag quotCxlEntriesGrp) {
this.quotCxlEntriesGrp = quotCxlEntriesGrp;
}

public Set<String> getTagIdsSet() {
return tagIdsSet;
}

public void setTagIdsSet(Set<String> tagIdsSet) {
this.tagIdsSet = tagIdsSet;
}

}


消息处理:略