您的位置:首页 > 其它

fix协议介绍15-批量取消订单执行报告(OrderMassCancelReport)

2013-12-13 20:06 399 查看


FIX.5.0SP2 Message

OrderMassCancelReport [type 'r']

<OrdMassCxlRpt>

The Order Mass Cancel Report is used to acknowledge an Order Mass Cancel Request. Note that each affected order that is canceled is acknowledged with a separate Execution Report or Order Cancel Reject message.

Added FIX.4.3

Expand Components | Collapse Components
Field or ComponentField NameFIXML nameReq'dCommentsDepr.

ComponentStandardHeaderBaseHeader
MsgType = r (lowercase R)

11ClOrdID@ClOrdIDClOrdID provided on the Order Mass Cancel Request. Unavailable in case of an unsolicited report, such as after a trading halt or a corporate action requiring the deletion of outstanding orders.

526SecondaryClOrdID@ClOrdID2

37OrderID@OrdID
Unique Identifier for the Order Mass Cancel Request assigned by the recipient of the Order Mass Cancel Request.
FIX.5.0SP1

1369MassActionReportID@MassActionReportID
Unique Identifier for the Order Mass Cancel Report assigned by the recipient of the Order Mass Cancel Request

198SecondaryOrderID@OrdID2Secondary Order ID assigned by the recipient of the Order Mass Cancel Request.
FIX.5.0SP1

530MassCancelRequestType@ReqTyp
Order Mass Cancel Request Type accepted by the system

531MassCancelResponse@Rsp
Indicates the action taken by the counterparty order handling system as a result of the Cancel Request

0 - Indicates Order Mass Cancel Request was rejected.

532MassCancelRejectReason@MassCxlRejRsnIndicates why Order Mass Cancel Request was rejected

Required if MassCancelResponse = 0

533TotalAffectedOrders@TotAffctdOrdsOptional field used to indicate the total number of orders affected by the Order Mass Cancel Request

ComponentAffectedOrdGrpAffectOrdList of orders affected by the Order Mass Cancel Request

ComponentNotAffectedOrdersGrpNotAffectedOrdersGrpList of orders not affected by Order Mass Cancel Request

336TradingSessionID@SesIDTrading Session in which orders are to be canceled

625TradingSessionSubID@SesSub

ComponentPartiesPtyInsert here the set of "Parties" (firm identification) fields defined in "common components of application messages"

ComponentTargetPartiesTgtPtyShould be populated with the values provided on the associated OrderMassCancelRequest(MsgType=Q).

ComponentInstrumentInstrmtInsert here the set of "Instrument" (symbology) fields defined in "Common Components of Application Messages"

ComponentUnderlyingInstrumentUndlyInsert here the set of "UnderlyingInstrument" (underlying symbology) fields defined in "Common Components of Application Messages"
消息实现:

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-30
*/
public class OrderMassCancelReportMsg extends BaseMsg {
private Tag clOrdID=new Tag("11","String",true);
private Tag parties=new PartiesTag(false);
private Tag instrument=new InstrumentTag(false);
private Tag transactTime=new Tag("60","UTCTimestamp",true);
private Tag massActionReportID=new Tag("1369","String",true);
private Tag massCancelRequestType=new Tag("530","char",true);
private Tag massCancelResponse=new Tag("531","char",true);
private Tag massCancelRejectReason=new Tag("532","int",false);
private Tag text=new Tag("58","String",false);

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

public OrderMassCancelReportMsg(){
this.getHeadEntity().getMsgType().setTagValue("r");
tagIdsSet.add("11");
tagIdsSet.add("60");
tagIdsSet.add("1369");
tagIdsSet.add("530");
tagIdsSet.add("531");
tagIdsSet.add("532");
tagIdsSet.add("58");
this.bodyEntity.getBodyTagList().add(clOrdID);
this.bodyEntity.getBodyTagList().add(parties);
this.bodyEntity.getBodyTagList().add(instrument);
this.bodyEntity.getBodyTagList().add(transactTime);
this.bodyEntity.getBodyTagList().add(massActionReportID);
this.bodyEntity.getBodyTagList().add(massCancelRequestType);
this.bodyEntity.getBodyTagList().add(massCancelResponse);
this.bodyEntity.getBodyTagList().add(massCancelRejectReason);
this.bodyEntity.getBodyTagList().add(text);
}

@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(InstrumentTag.tagIdsSet.contains(firstTagId)){
input=this.instrument.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(massCancelRequestType.getTagValue()!=null){
if(!MsgUtil.massCancelRequestType.contains(massCancelRequestType.getTagValue())){
throw new InValidDataException("massCancelRequestType错误["+massCancelRequestType.getTagId()+"="+massCancelRequestType.getTagValue()+"]");
}
}
if(massCancelResponse.getTagValue()!=null){
if(!MsgUtil.massCancelResponse.contains(massCancelResponse.getTagValue())){
throw new InValidDataException("massCancelResponse错误["+massCancelResponse.getTagId()+"="+massCancelResponse.getTagValue()+"]");
}
}
if(massCancelRejectReason.getTagValue()!=null){
if(!((Integer.parseInt(massCancelRejectReason.getTagValue())>=0&&Integer.parseInt(massCancelRejectReason.getTagValue())<=11)||Integer.parseInt(massCancelRejectReason.getTagValue())==99)){
throw new InValidDataException("massCancelRejectReason错误["+massCancelRejectReason.getTagId()+"="+massCancelRejectReason.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 getMassActionReportID() {
return massActionReportID;
}

public void setMassActionReportID(Tag massActionReportID) {
this.massActionReportID = massActionReportID;
}

public Tag getMassCancelRequestType() {
return massCancelRequestType;
}

public void setMassCancelRequestType(Tag massCancelRequestType) {
this.massCancelRequestType = massCancelRequestType;
}

public Tag getMassCancelResponse() {
return massCancelResponse;
}

public void setMassCancelResponse(Tag massCancelResponse) {
this.massCancelResponse = massCancelResponse;
}

public Tag getMassCancelRejectReason() {
return massCancelRejectReason;
}

public void setMassCancelRejectReason(Tag massCancelRejectReason) {
this.massCancelRejectReason = massCancelRejectReason;
}

public Tag getText() {
return text;
}

public void setText(Tag text) {
this.text = text;
}

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

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

}


消息处理:略
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: