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

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 Component Field Name FIXML name Req'd Comments Depr.
Component StandardHeader BaseHeader

MsgType = r (lowercase R)

 
11 ClOrdID @ClOrdID  

ClOrdID 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.

 
526 SecondaryClOrdID @ClOrdID2      
37 OrderID @OrdID

Unique Identifier for the Order Mass Cancel Request assigned by the recipient of the Order Mass Cancel Request.

FIX.5.0SP1
1369 MassActionReportID @MassActionReportID

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

 
198 SecondaryOrderID @OrdID2  

Secondary Order ID assigned by the recipient of the Order Mass Cancel Request.

FIX.5.0SP1
530 MassCancelRequestType @ReqTyp

Order Mass Cancel Request Type accepted by the system

 
531 MassCancelResponse @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.

 
532 MassCancelRejectReason @MassCxlRejRsn  

Indicates why Order Mass Cancel Request was rejected

Required if MassCancelResponse = 0

 
533 TotalAffectedOrders @TotAffctdOrds  

Optional field used to indicate the total number of orders affected by the Order Mass Cancel Request

 
Component AffectedOrdGrp AffectOrd  

List of orders affected by the Order Mass Cancel Request

 
Component NotAffectedOrdersGrp NotAffectedOrdersGrp  

List of orders not affected by Order Mass Cancel Request

 
336 TradingSessionID @SesID  

Trading Session in which orders are to be canceled

 
625 TradingSessionSubID @SesSub      
Component Parties Pty  

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

 
Component TargetParties TgtPty  

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

 
Component Instrument Instrmt  

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

 
Component UnderlyingInstrument Undly  

Insert 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;
	}

}

消息处理:略





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hxpjava1

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值