首页 > 其他分享 >fix协议介绍18-取消查询订单(QuoteCancel)

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

时间:2023-01-01 14:00:13浏览次数:66  
标签:18 fix new public quotes Tag QuoteCancel input quoteCancelType



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

}


消息处理:略



标签:18,fix,new,public,quotes,Tag,QuoteCancel,input,quoteCancelType
From: https://blog.51cto.com/u_11979904/5982992

相关文章

  • 联想小新+Windows10+Ubuntu18.04双系统安装+引导设置过程全记录
    写在前面双系统安装配置主要过程引导设置主要参考Ubuntu卸载需要的工具具体步骤情况一情况二主要参考后记2020.5.29更新关于卸载关于主题的配置写在前面又是折腾的一天,双系......
  • P1801 黑匣子
    \(P1801\)黑匣子虽说是堆题,但也可以用主席树不是?对于每个要\(get\)的地方,相当于询问区间为\([1,x]\),其实就是模板题啦#include<algorithm>#include<cstdio>#includ......
  • BM18 二维数组中的查找
    题目描述给定一个每个元素都是升序数组的二维数组和一个target,判断target是否在数组中返回boolean类型思路分析方法一:遍历每个元素,判断是否相等方法二:将数组拍平,也......
  • Selenium58-优化fixture
    v4_1问题代码运行效率较低:prepare_and_exit包含所有前置和后置步骤,每组测试数据都从重新启动浏览器开始到关闭浏览器结束。。思考:是否可以省略每组数据测试时的重......
  • Selenium57-使用fixture
    第四版使用fixturetest_后台_双创_基础设置_赛区管理_添加赛区_case_v4_1.py使用fixture来做前置和后置处理。使用yield来分隔前置后后置处理步骤。定义prepare_......
  • Gitea 1.18.0 | API、表单、PR、LaTeX、代码搜索、Email、包管理等18项重大更新如约而
    经过数月的开发,我们自豪地推出了正式版的Gitea1.18.0。新的系统整合了日积月累的535个PR,包含修复补丁以及功能更改,我们建议管理员升级系统前创建快照、备份数据,确保切换......
  • LOJ #2776. 「BalticOI 2018」蠕虫之忧
    题面传送门拼图题/fn首先考虑先搞一个通解出来。考虑一维的情况,显然是二分,设区间\([l,r]\),询问\(mid\)和\(mid+1\)的大小关系,如果\(H_{mid}<H_{mid+1}\),则\([mid+1,r]\)......
  • tomcat报错总结C:\Program Files\Apache Software Foundation\Tomcat 8.5\logs\c
    错误问题一java.util.logging.ErrorManager:4java.io.FileNotFoundException:C:\ProgramFiles\ApacheSoftwareFoundation\Tomcat8.5\logs\catalina.2018-11-07.log(......
  • 曾行贿多达18起,这家疫苗龙头究竟怎么了?
    文|熔财经作者|艾尼欧疫苗龙头北京科兴生物(通常称“科兴生物”)再度引发争议。近日,名为#科兴三针防感染率仅8%是真的吗#的话题,冲上新浪微博和抖音的热搜榜,获得了不少网友的关......
  • Python__18--函数的定义与创建
    1函数的定义执行特定任务以完成特定功能的一段代码特点:复用代码隐藏细节提高可维护性提高可读性便于调试2函数的创建def函数名([输入参数]):函数体return......