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

35 篇文章 0 订阅
34 篇文章 16 订阅


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

}

消息处理:略



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

hxpjava1

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

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

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

打赏作者

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

抵扣说明:

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

余额充值