首页 > 其他分享 >fix协议介绍13-执行报告(ExecutionReport)

fix协议介绍13-执行报告(ExecutionReport)

时间:2023-01-01 14:31:09浏览次数:70  
标签:13 Tag tagIdsSet fix add ExecutionReport void new public


FIX.5.0SP2 Message

ExecutionReport [type '8']

<ExecRpt>



The execution report message is used to:



1. confirm the receipt of an order



2. confirm changes to an existing order (i.e. accept cancel and replace requests)



3. relay order status information



4. relay fill information on working orders



5. relay fill information on tradeable or restricted tradeable quotes



6. reject orders



7. report post-trade fees calculations associated with a trade




Added  FIX.2.7

Expand Components | Collapse Components

 

Field or Component

Field Name

FIXML name

Req'd

Comments

Depr.



fix协议介绍13-执行报告(ExecutionReport)_sed

fix协议介绍13-执行报告(ExecutionReport)_sed_02

fix协议介绍13-执行报告(ExecutionReport)_ide_03

fix协议介绍13-执行报告(ExecutionReport)_ci_04

fix协议介绍13-执行报告(ExecutionReport)_sed_05

fix协议介绍13-执行报告(ExecutionReport)_ci_06

fix协议介绍13-执行报告(ExecutionReport)_ide_07

fix协议介绍13-执行报告(ExecutionReport)_ci_08

fix协议介绍13-执行报告(ExecutionReport)_ci_09

fix协议介绍13-执行报告(ExecutionReport)_sed_10

fix协议介绍13-执行报告(ExecutionReport)_sed_11

fix协议介绍13-执行报告(ExecutionReport)_ide_12

fix协议介绍13-执行报告(ExecutionReport)_ide_13

fix协议介绍13-执行报告(ExecutionReport)_ci_14

fix协议介绍13-执行报告(ExecutionReport)_ci_15

fix协议介绍13-执行报告(ExecutionReport)_ci_16

fix协议介绍13-执行报告(ExecutionReport)_ci_17

fix协议介绍13-执行报告(ExecutionReport)_sed_18

fix协议介绍13-执行报告(ExecutionReport)_ide_19

fix协议介绍13-执行报告(ExecutionReport)_ci_20

fix协议介绍13-执行报告(ExecutionReport)_sed_21

fix协议介绍13-执行报告(ExecutionReport)_ci_22

fix协议介绍13-执行报告(ExecutionReport)_sed_23

fix协议介绍13-执行报告(ExecutionReport)_ci_24

fix协议介绍13-执行报告(ExecutionReport)_ide_25


消息实现:

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 ExecutionReportMsg extends BaseMsg {
private Tag clOrdID=new Tag("11","String",false);
private Tag cumQty=new Tag("14","Qty",true);
private Tag execID=new Tag("17","String",true);
private Tag execType=new Tag("150","char",true);
private Tag leavesQty=new Tag("151","Qty",true);
private Tag lotType=new Tag("1093","char",false);
private Tag maxPriceLevels=new Tag("1090","int",false);
private Tag parties=new PartiesTag(false);
private Tag orderID=new Tag("37","String",true);
private Tag orderQtyData=new OrderQtyDataTag(false);
private Tag ordStatus=new Tag("39","char",true);
private Tag ordType=new Tag("40","char",false);
private Tag price=new Tag("44","Price",false);
private Tag instrument=new InstrumentTag(true);
private Tag side=new Tag("54","char",true);
private Tag timeInForce=new Tag("59","char",false);
private Tag transactTime=new Tag("60","UTCTimestamp",false);
private Tag ordRejReason=new Tag("103","int",false);
private Tag rejectText=new Tag("1328","String",false);
private Tag lastPx=new Tag("31","Price",false);
private Tag lastQty=new Tag("32","Qty",false);
private Tag matchType=new Tag("574","String",false);
private Tag trdMatchID=new Tag("880","String",false);
private Tag execRefID=new Tag("19","String",false);
private Tag execRestatementReason=new Tag("378","int",false);
private Tag origClOrdID=new Tag("41","String",false);
private Tag copyMsgIndicator=new Tag("797","Boolean",false);

private Set<String> tagIdsSet=new HashSet<String>();
public ExecutionReportMsg(){
this.getHeadEntity().getMsgType().setTagValue("8");
tagIdsSet.add("11");
tagIdsSet.add("14");
tagIdsSet.add("17");
tagIdsSet.add("150");
tagIdsSet.add("151");
tagIdsSet.add("1093");
tagIdsSet.add("1090");
tagIdsSet.add("37");
tagIdsSet.add("39");
tagIdsSet.add("40");
tagIdsSet.add("44");
tagIdsSet.add("54");
tagIdsSet.add("59");
tagIdsSet.add("60");
tagIdsSet.add("103");
tagIdsSet.add("1328");
tagIdsSet.add("31");
tagIdsSet.add("32");
tagIdsSet.add("574");
tagIdsSet.add("880");
tagIdsSet.add("19");
tagIdsSet.add("378");
tagIdsSet.add("41");
tagIdsSet.add("797");
this.bodyEntity.getBodyTagList().add(clOrdID);
this.bodyEntity.getBodyTagList().add(cumQty);
this.bodyEntity.getBodyTagList().add(execID);
this.bodyEntity.getBodyTagList().add(execType);
this.bodyEntity.getBodyTagList().add(leavesQty);
this.bodyEntity.getBodyTagList().add(lotType);
this.bodyEntity.getBodyTagList().add(maxPriceLevels);
this.bodyEntity.getBodyTagList().add(parties);
this.bodyEntity.getBodyTagList().add(orderID);
this.bodyEntity.getBodyTagList().add(orderQtyData);
this.bodyEntity.getBodyTagList().add(ordStatus);
this.bodyEntity.getBodyTagList().add(ordType);
this.bodyEntity.getBodyTagList().add(price);
this.bodyEntity.getBodyTagList().add(instrument);
this.bodyEntity.getBodyTagList().add(side);
this.bodyEntity.getBodyTagList().add(timeInForce);
this.bodyEntity.getBodyTagList().add(transactTime);
this.bodyEntity.getBodyTagList().add(ordRejReason);
this.bodyEntity.getBodyTagList().add(rejectText);
this.bodyEntity.getBodyTagList().add(lastPx);
this.bodyEntity.getBodyTagList().add(lastQty);
this.bodyEntity.getBodyTagList().add(matchType);
this.bodyEntity.getBodyTagList().add(trdMatchID);
this.bodyEntity.getBodyTagList().add(execRefID);
this.bodyEntity.getBodyTagList().add(execRestatementReason);
this.bodyEntity.getBodyTagList().add(origClOrdID);
this.bodyEntity.getBodyTagList().add(copyMsgIndicator);
}

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(OrderQtyDataTag.tagIdsSet.contains(firstTagId)){
input=this.orderQtyData.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(execType.getTagValue()!=null){
if(!MsgUtil.execType.contains(execType.getTagValue())){
throw new InValidDataException("execType错误["+execType.getTagId()+"="+execType.getTagValue()+"]");
}
}
if(lotType.getTagValue()!=null){
if(!MsgUtil.lotType.contains(lotType.getTagValue())){
throw new InValidDataException("lotType错误["+lotType.getTagId()+"="+lotType.getTagValue()+"]");
}
}
if(ordStatus.getTagValue()!=null){
if(!MsgUtil.ordStatus.contains(ordStatus.getTagValue())){
throw new InValidDataException("ordStatus错误["+ordStatus.getTagId()+"="+ordStatus.getTagValue()+"]");
}
}
if(ordType.getTagValue()!=null){
if(!MsgUtil.ordType.contains(ordType.getTagValue())){
throw new InValidDataException("ordType错误["+ordType.getTagId()+"="+ordType.getTagValue()+"]");
}
}
if(side.getTagValue()!=null){
if(!MsgUtil.side.contains(side.getTagValue())){
throw new InValidDataException("side错误["+side.getTagId()+"="+side.getTagValue()+"]");
}
}
if(timeInForce.getTagValue()!=null){
if(!MsgUtil.timeInForce.contains(timeInForce.getTagValue())){
throw new InValidDataException("timeInForce错误["+timeInForce.getTagId()+"="+timeInForce.getTagValue()+"]");
}
}
if(ordRejReason.getTagValue()!=null){
if(!((Integer.parseInt(ordRejReason.getTagValue())>=0&&Integer.parseInt(ordRejReason.getTagValue())<=19)||Integer.parseInt(ordRejReason.getTagValue())==99)){
throw new InValidDataException("ordRejReason错误["+ordRejReason.getTagId()+"="+ordRejReason.getTagValue()+"]");
}
}
if(matchType.getTagValue()!=null){
if(!MsgUtil.matchType.contains(matchType.getTagValue())){
throw new InValidDataException("matchType错误["+matchType.getTagId()+"="+matchType.getTagValue()+"]");
}
}
}

public Tag getClOrdID() {
return clOrdID;
}

public void setClOrdID(Tag clOrdID) {
this.clOrdID = clOrdID;
}

public Tag getCumQty() {
return cumQty;
}

public void setCumQty(Tag cumQty) {
this.cumQty = cumQty;
}

public Tag getExecID() {
return execID;
}

public void setExecID(Tag execID) {
this.execID = execID;
}

public Tag getExecType() {
return execType;
}

public void setExecType(Tag execType) {
this.execType = execType;
}

public Tag getLeavesQty() {
return leavesQty;
}

public void setLeavesQty(Tag leavesQty) {
this.leavesQty = leavesQty;
}

public Tag getLotType() {
return lotType;
}

public void setLotType(Tag lotType) {
this.lotType = lotType;
}

public Tag getMaxPriceLevels() {
return maxPriceLevels;
}

public void setMaxPriceLevels(Tag maxPriceLevels) {
this.maxPriceLevels = maxPriceLevels;
}

public Tag getParties() {
return parties;
}

public void setParties(Tag parties) {
this.parties = parties;
}

public Tag getOrderID() {
return orderID;
}

public void setOrderID(Tag orderID) {
this.orderID = orderID;
}

public Tag getOrderQtyData() {
return orderQtyData;
}

public void setOrderQtyData(Tag orderQtyData) {
this.orderQtyData = orderQtyData;
}

public Tag getOrdStatus() {
return ordStatus;
}

public void setOrdStatus(Tag ordStatus) {
this.ordStatus = ordStatus;
}

public Tag getOrdType() {
return ordType;
}

public void setOrdType(Tag ordType) {
this.ordType = ordType;
}

public Tag getPrice() {
return price;
}

public void setPrice(Tag price) {
this.price = price;
}

public Tag getInstrument() {
return instrument;
}

public void setInstrument(Tag instrument) {
this.instrument = instrument;
}

public Tag getSide() {
return side;
}

public void setSide(Tag side) {
this.side = side;
}

public Tag getTimeInForce() {
return timeInForce;
}

public void setTimeInForce(Tag timeInForce) {
this.timeInForce = timeInForce;
}

public Tag getTransactTime() {
return transactTime;
}

public void setTransactTime(Tag transactTime) {
this.transactTime = transactTime;
}

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

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

public Tag getOrdRejReason() {
return ordRejReason;
}

public void setOrdRejReason(Tag ordRejReason) {
this.ordRejReason = ordRejReason;
}

public Tag getRejectText() {
return rejectText;
}

public void setRejectText(Tag rejectText) {
this.rejectText = rejectText;
}

public Tag getLastPx() {
return lastPx;
}

public void setLastPx(Tag lastPx) {
this.lastPx = lastPx;
}

public Tag getLastQty() {
return lastQty;
}

public void setLastQty(Tag lastQty) {
this.lastQty = lastQty;
}

public Tag getMatchType() {
return matchType;
}

public void setMatchType(Tag matchType) {
this.matchType = matchType;
}

public Tag getTrdMatchID() {
return trdMatchID;
}

public void setTrdMatchID(Tag trdMatchID) {
this.trdMatchID = trdMatchID;
}

public Tag getExecRefID() {
return execRefID;
}

public void setExecRefID(Tag execRefID) {
this.execRefID = execRefID;
}

public Tag getExecRestatementReason() {
return execRestatementReason;
}

public void setExecRestatementReason(Tag execRestatementReason) {
this.execRestatementReason = execRestatementReason;
}

public Tag getOrigClOrdID() {
return origClOrdID;
}

public void setOrigClOrdID(Tag origClOrdID) {
this.origClOrdID = origClOrdID;
}

public Tag getCopyMsgIndicator() {
return copyMsgIndicator;
}

public void setCopyMsgIndicator(Tag copyMsgIndicator) {
this.copyMsgIndicator = copyMsgIndicator;
}

}


处理逻辑:略



标签:13,Tag,tagIdsSet,fix,add,ExecutionReport,void,new,public
From: https://blog.51cto.com/u_11979904/5983014

相关文章

  • Fix协议介绍10-取消订单请求(OrderCancelRequest)
    FIX.5.0SP2MessageOrderCancelRequest [type'F']<OrdCxlReq>Theordercancelrequestmessagerequeststhecancellationofalloftheremainingquantityofan......
  • fix协议介绍12-取消订单被拒(OrderCacelReject)
    FIX.5.0SP2MessageOrderCancelReject [type'9']<OrdCxlRej>Theordercancelrejectmessageisissuedbythebrokeruponreceiptofacancelrequestorcancel......
  • fix协议介绍16-查询叮当(quote)
    FIX.5.0SP2MessageQuote [type'S']<Quot>TheQuotemessageisusedastheresponsetoaQuoteRequestoraQuoteResponsemessageinbothindicative,tradea......
  • fix协议介绍18-取消查询订单(QuoteCancel)
    FIX.5.0SP2MessageQuoteCancel [type'Z']<QuotCxl>TheQuoteCancelmessageisusedbyanoriginatorofquotestocancelquotes.TheQuoteCancelmessages......
  • 13.二叉排序树
    引入需求:给定一个数列{7,3,10,12,5,1,9}要求能够高效的完成对数据的查询和添加......
  • AcWing 1359. 洛谷P1457 城堡
    解题思路\(\qquad\)这道题目是需要维护各种连通块信息的,所以这里我们可以也用并查集维护。这题我们如果注意一点细节,也是可以让代码变得很简洁的:\(\qquad\quad1.\)这道......
  • day13
    ##循环结构![image-20221229174904825](C:\Users\biao\AppData\Roaming\Typora\typora-user-images\image-20221229174904825.png)![image-20221229175121292](C:\Users......
  • E. Cross Swapping-带权并查集cf1713
    E.CrossSwappinghttps://codeforces.ml/problemset/problem/1713/E题意给定n*n的矩阵每次可以选定第k行和第k列交换位置操作次数不限求最小字典序的矩阵思路让......
  • CF1383E Strange Operation
    CF1383EStrangeOperation好题啊!!观察一下这个操作的本质:每次选择相邻两个位置,如果有0会直接消掉一个0,否则消掉一个1。这启发我们根据1的数量来做题。如果把相邻......
  • Selenium58-优化fixture
    v4_1问题代码运行效率较低:prepare_and_exit包含所有前置和后置步骤,每组测试数据都从重新启动浏览器开始到关闭浏览器结束。。思考:是否可以省略每组数据测试时的重......