fix协议介绍14-批量取消订单(OrderMassCancelRequest)

FIX.5.0SP2 Message

OrderMassCancelRequest [type 'q']

<OrdMassCxlReq>

The order mass cancel request message requests the cancellation of all of the remaining quantity of a group of orders matching criteria specified within the request. NOTE: This message can only be used to cancel order messages (reduce the full quantity).


Added  FIX.4.3

Expand Components | Collapse Components

  Field or Component Field Name FIXML name Req'd Comments Depr.
Component StandardHeader BaseHeader

MsgType = q (lowercase Q)

 
11 ClOrdID @ClOrdID

Unique ID of Order Mass Cancel Request as assigned by the institution.

 
526 SecondaryClOrdID @ClOrdID2      
530 MassCancelRequestType @ReqTyp

Specifies the type of cancellation requested

 
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  

Can be used to specify the parties to whom the Order Mass Cancel should apply.

 
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"

 
1301 MarketID @MktID  

Required for MassCancelRequestType = 8 (Cancel orders for a market)

 
1300 MarketSegmentID @MktSegID  

Required for MassCancelRequestType = 9 (Cancel orders for a market segment)

 
54 Side @Side  

Optional qualifier used to indicate the side of the market for which orders are to be canceled. Absence of this field indicates that orders are to be canceled regardless of side.

 
60 TransactTime @TxnTm

Time this order request was initiated/released by the trader or trading system.

 
58 Text @Txt      
354 EncodedTextLen @EncTxtLen  

Must be set if EncodedText field is specified and must immediately precede it.

 
355 EncodedText @EncTxt  

Encoded (non-ASCII characters) representation of the Text field in the encoded format specified via the MessageEncoding field.

 
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 OrderMassCancelRequestMsg 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",false);
	private Tag massCancelRequestType=new Tag("530","char",true);
	private Tag marketSegmentID=new Tag("1300","String",false);
	
	private Set<String> tagIdsSet=new HashSet<String>();
	
	public OrderMassCancelRequestMsg(){
		this.getHeadEntity().getMsgType().setTagValue("q");
		tagIdsSet.add("11");
		tagIdsSet.add("60");
		tagIdsSet.add("54");
		tagIdsSet.add("530");
		tagIdsSet.add("1300");
		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(massCancelRequestType);
		this.bodyEntity.getBodyTagList().add(marketSegmentID);
	}
	
	@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(massCancelRequestType.getTagValue()!=null){
			if(!MsgUtil.massCancelRequestType.contains(massCancelRequestType.getTagValue())){
				throw new InValidDataException("massCancelRequestType错误["+massCancelRequestType.getTagId()+"="+massCancelRequestType.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 getMassCancelRequestType() {
		return massCancelRequestType;
	}

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

	public Tag getMarketSegmentID() {
		return marketSegmentID;
	}

	public void setMarketSegmentID(Tag marketSegmentID) {
		this.marketSegmentID = marketSegmentID;
	}

	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、付费专栏及课程。

余额充值