首页 > 其他分享 >fix协议介绍20-TradeCaptureReportAck

fix协议介绍20-TradeCaptureReportAck

时间:2023-01-01 14:34:27浏览次数:66  
标签:TradeCaptureReportAck fix bodyEntity trade Tag getTagValue new 20 public


FIX.5.0SP2 Message

TradeCaptureReportAck [type 'AR']

<TrdCaptRptAck>


The Trade Capture Report Ack message can be:



• Used to acknowledge trade capture reports received from a counterparty



• Used to reject a trade capture report received from a counterparty




Added  FIX.4.4

Expand Components | Collapse Components

 

Field or Component

Field Name

FIXML name

Req'd

Comments

Depr.


Component

StandardHeader

BaseHeader


MsgType = AR

 


​571​

​TradeReportID​

@RptID

 

Unique identifier for the Trade Capture Report

 


​1003​

​TradeID​

@TrdID

 

 

 


​1040​

​SecondaryTradeID​

@TrdID2

 

 

 


​1041​

​FirmTradeID​

@FirmTrdID

 

 

 


​1042​

​SecondaryFirmTradeID​

@FirmTrdID2

 

 

 


​487​

​TradeReportTransType​

@TransTyp

 

Identifies Trade Report message transaction type.

 


​856​

​TradeReportType​

@RptTyp

 

Indicates action to take on trade

 


​828​

​TrdType​

@TrdTyp

 

 

 


​829​

​TrdSubType​

@TrdSubTyp

 

 

 


​855​

​SecondaryTrdType​

@TrdTyp2

 

 

 


​1123​

​TradeHandlingInstr​

@TrdHandlInst

 

 

 


​1124​

​OrigTradeHandlingInstr​

@OrigTrdHandlInst

 

 

 


​1125​

​OrigTradeDate​

@OrigTrdDt

 

Used to preserve original trade date when original trade is being referenced in a subsequent trade transaction such as a transfer

 


​1126​

​OrigTradeID​

@OrigTrdID

 

Used to preserve original trade id when original trade is being referenced in a subsequent trade transaction such as a transfer

 


​1127​

​OrigSecondaryTradeID​

@OrignTrdID2

 

Used to preserve original secondary trade id when original trade is being referenced in a subsequent trade transaction such as a transfer

 


​830​

​TransferReason​

@TrnsfrRsn

 

 

 


Component

RootParties

Pty

 

Insert here the set of "Root Parties" (firm identification) fields defined in "common components of application messages" Range of values on report:

 


​150​

​ExecType​

@ExecTyp

 

Type of Execution being reported:

Uses subset of ExecType for Trade Capture Reports

 


​572​

​TradeReportRefID​

@RptRefID

 

The TradeReportID that is being referenced for some action, such as correction or cancellation

 


​881​

​SecondaryTradeReportRefID​

@RptRefID2

 

The SecondaryTradeReportID that is being referenced for some action, such as correction or cancellation

FIX.5.0


​939​

​TrdRptStatus​

@TrdRptStat

 

Status of Trade Report

 


​751​

​TradeReportRejectReason​

@RejRsn

 

Reason for Rejection of Trade Report

 


​818​

​SecondaryTradeReportID​

@RptID2

 

 

FIX.5.0


​263​

​SubscriptionRequestType​

@SubReqTyp

 

Used to subscribe / unsubscribe for trade capture reports

If the field is absent, the value 0 will be the default

 


​820​

​TradeLinkID​

@LinkID

 

Used to associate a group of trades together. Useful for average price calculations.

 


​880​

​TrdMatchID​

@MtchID

 

 

 


​17​

​ExecID​

@ExecID

 

Exchanged assigned Execution ID (Trade Identifier)

 


​527​

​SecondaryExecID​

@ExecID2

 

 

 


​378​

​ExecRestatementReason​

@ExecRstmtRsn

 

 

 


​570​

​PreviouslyReported​

@PrevlyRpted

 

 

 


​423​

​PriceType​

@PxTyp

 

 

 


​822​

​UnderlyingTradingSessionID​

@UndSesID

 

 

 


​823​

​UnderlyingTradingSessionSubID​

@UndSesSub

 

 

 


​716​

​SettlSessID​

@SetSesID

 

 

 


​717​

​SettlSessSubID​

@SetSesSub

 

 

 


​854​

​QtyType​

@QtyTyp

 

 

 


​32​

​LastQty​

@LastQty

 

 

 


​31​

​LastPx​

@LastPx

 

 

 



​1430​

​VenueType​

@VenuTyp

 

 

 


​1300​

​MarketSegmentID​

@MktSegID

 

 

 


​1301​

​MarketID​

@MktID

 

 

 


Component

Instrument

Instrmt


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

 


​669​

​LastParPx​

@LastParPx

 

 

 


​1056​

​CalculatedCcyLastQty​

@CalcCcyLastQty

 

 

 


​1071​

​LastSwapPoints​

@LastSwapPnts

 

 

 


​15​

​Currency​

@Ccy

 

Primary currency of the specified currency pair. Used to qualify LastQty and GrossTradeAmout

 


​120​

​SettlCurrency​

@SettlCcy

 

Contra currency of the deal. Used to qualify CalculatedCcyLastQty

 


​194​

​LastSpotRate​

@LastSpotRt

 

 

 


​195​

​LastForwardPoints​

@LastFwdPnts

 

 

 


​30​

​LastMkt​

@LastMkt

 

 

 


​75​

​TradeDate​

@TrdDt

 

 

 


​715​

​ClearingBusinessDate​

@BizDt

 

 

 


​6​

​AvgPx​

@AvgPx

 

 

 


​819​

​AvgPxIndicator​

@AvgPxInd

 

 

 


​442​

​MultiLegReportingType​

@MLegRptTyp

 

 

 


​824​

​TradeLegRefID​

@TrdLegRefID

 

 

 


​60​

​TransactTime​

@TxnTm

 

Time ACK was issued by matching system, trading system or counterparty

 


​63​

​SettlType​

@SettlTyp

 

 

 


Component

UndInstrmtGrp

Undly

 

 

 


​573​

​MatchStatus​

@MtchStat

 

 

 


​574​

​MatchType​

@MtchTyp

 

 

 


​797​

​CopyMsgIndicator​

@CopyMsgInd

 

 

 


Component

TrdRepIndicatorsGrp

TrdRepIndicatorsGrp

 

 

 


​852​

​PublishTrdIndicator​

@PubTrdInd

 

 

FIX.5.0


​1390​

​TradePublishIndicator​

@TrdPubInd

 

 

 


​853​

​ShortSaleReason​

@ShrtSaleRsn

 

 

 


Component

TrdInstrmtLegGrp

TrdLeg

 

 

 


Component

TrdRegTimestamps

TrdRegTS

 

 

 


​725​

​ResponseTransportType​

@RspTransportTyp

 

Ability to specify whether the response to the request should be delivered inband or via pre-arranged out-of-band transport.

 


​726​

​ResponseDestination​

@RspDest

 

URI destination name. Used if ResponseTransportType is out-of-band.

 


​58​

​Text​

@Txt

 

May be used by the executing market to record any execution Details that are particular to that market

 


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

 


​1015​

​AsOfIndicator​

@AsOfInd

 

Indicates if the trade is an outtrade from a previous day

 


​635​

​ClearingFeeIndicator​

@ClrFeeInd

 

 

 


Component

PositionAmountData

Amt

 

Insert here here the set of "Position Amount Data" fields defined in "Common Components of Application Messages"

 


​994​

​TierCode​

@TierCD

 

Indicates the algorithm (tier) used to match a trade

 


​1011​

​MessageEventSource​

@MsgEvtSrc

 

Used to identify the event or source which gave rise to a message

 


​779​

​LastUpdateTime​

@LastUpdateTm

 

Used to indicate reports after a specific time

 


​991​

​RndPx​

@RndPx

 

Specifies the rounded price to quoted precision.

 


Component

TrdCapRptAckSideGrp

RptSide

 

 

 


​1135​

​RptSys​

@RptSys

 

 

 



​381​

​GrossTradeAmt​

@GrossTrdAmt

 

(LastQty(32) * LastPx(31) or LastParPx(669)) For Fixed Income, LastParPx(669) is used when LastPx(31) is not expressed as "percent of par" price.

 


​64​

​SettlDate​

@SettlDt

 

 

 


​1329​

​FeeMultiplier​

@FeeMult

 

 

 


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 TradeCaptureReportAckMsg extends BaseMsg {
private Tag tradeReportID = new Tag("571", "String", false);
private Tag tradeID = new Tag("1003", "String", false);
private Tag tradeReportTransType = new Tag("487", "int", false);
private Tag tradeReportType = new Tag("856", "int", false);
private Tag tradeHandlingInstr = new Tag("1123", "char", false);
private Tag trdRptStatus = new Tag("939", "int", false);
private Tag transactTime = new Tag("60", "UTCTimestamp", false);
private Tag trdCapRptSideGrp = new TrdCapRptSideGrpTag(false);
private Tag instrument = new InstrumentTag(true);
private Tag tradeReportRejectReason = new Tag("751", "int", false);
private Tag rejectText = new Tag("1328", "String", false);

public TradeCaptureReportAckMsg() {
this.getHeadEntity().getMsgType().setTagValue("AR");
this.bodyEntity.getBodyTagList().add(tradeReportID);
this.bodyEntity.getBodyTagList().add(tradeID);
this.bodyEntity.getBodyTagList().add(tradeReportTransType);
this.bodyEntity.getBodyTagList().add(tradeReportType);
this.bodyEntity.getBodyTagList().add(tradeHandlingInstr);
this.bodyEntity.getBodyTagList().add(trdRptStatus);
this.bodyEntity.getBodyTagList().add(transactTime);
this.bodyEntity.getBodyTagList().add(trdCapRptSideGrp);
this.bodyEntity.getBodyTagList().add(instrument);
this.bodyEntity.getBodyTagList().add(tradeReportRejectReason);
this.bodyEntity.getBodyTagList().add(rejectText);
}

@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("552")) {
input = this.getTrdCapRptSideGrp().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 (tradeReportTransType.getTagValue() != null) {
if (!(Integer.parseInt(tradeReportTransType.getTagValue()) >= 0 && Integer
.parseInt(tradeReportTransType.getTagValue()) <= 5)) {
throw new InValidDataException("tradeReportTransType错误["
+ tradeReportTransType.getTagId() + "="
+ tradeReportTransType.getTagValue() + "]");
}
}
if (tradeReportType.getTagValue() != null) {
if (!(Integer.parseInt(tradeReportType.getTagValue()) >= 0 && Integer
.parseInt(tradeReportType.getTagValue()) <= 15)) {
throw new InValidDataException("tradeReportType错误["
+ tradeReportType.getTagId() + "="
+ tradeReportType.getTagValue() + "]");
}
}
if (tradeHandlingInstr.getTagValue() != null) {
if (!MsgUtil.tradeHandlingInstr.contains(tradeHandlingInstr
.getTagValue())) {
throw new InValidDataException("tradeHandlingInstr错误["
+ tradeHandlingInstr.getTagId() + "="
+ tradeHandlingInstr.getTagValue() + "]");
}
}
if (trdRptStatus.getTagValue() != null) {
if (!(Integer.parseInt(trdRptStatus.getTagValue()) == 0
|| Integer.parseInt(trdRptStatus.getTagValue()) == 1 || Integer
.parseInt(trdRptStatus.getTagValue()) == 3)) {
throw new InValidDataException("trdRptStatus错误["
+ trdRptStatus.getTagId() + "="
+ trdRptStatus.getTagValue() + "]");
}
}
if (tradeReportRejectReason.getTagValue() != null) {
if (!(Integer.parseInt(tradeReportRejectReason.getTagValue()) >= 0
&& Integer.parseInt(tradeReportRejectReason.getTagValue()) <= 4 || Integer
.parseInt(tradeReportRejectReason.getTagValue()) == 99)) {
throw new InValidDataException("tradeReportRejectReason错误["
+ tradeReportRejectReason.getTagId() + "="
+ tradeReportRejectReason.getTagValue() + "]");
}
}
}

public Tag getTradeReportID() {
return tradeReportID;
}

public void setTradeReportID(Tag tradeReportID) {
this.tradeReportID = tradeReportID;
}

public Tag getTradeID() {
return tradeID;
}

public void setTradeID(Tag tradeID) {
this.tradeID = tradeID;
}

public Tag getTradeReportTransType() {
return tradeReportTransType;
}

public void setTradeReportTransType(Tag tradeReportTransType) {
this.tradeReportTransType = tradeReportTransType;
}

public Tag getTradeReportType() {
return tradeReportType;
}

public void setTradeReportType(Tag tradeReportType) {
this.tradeReportType = tradeReportType;
}

public Tag getTradeHandlingInstr() {
return tradeHandlingInstr;
}

public void setTradeHandlingInstr(Tag tradeHandlingInstr) {
this.tradeHandlingInstr = tradeHandlingInstr;
}

public Tag getTrdRptStatus() {
return trdRptStatus;
}

public void setTrdRptStatus(Tag trdRptStatus) {
this.trdRptStatus = trdRptStatus;
}

public Tag getTransactTime() {
return transactTime;
}

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

public Tag getTrdCapRptSideGrp() {
return trdCapRptSideGrp;
}

public void setTrdCapRptSideGrp(Tag trdCapRptSideGrp) {
this.trdCapRptSideGrp = trdCapRptSideGrp;
}

public Tag getInstrument() {
return instrument;
}

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

public Tag getTradeReportRejectReason() {
return tradeReportRejectReason;
}

public void setTradeReportRejectReason(Tag tradeReportRejectReason) {
this.tradeReportRejectReason = tradeReportRejectReason;
}

public Tag getRejectText() {
return rejectText;
}

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

}


消息处理:略



标签:TradeCaptureReportAck,fix,bodyEntity,trade,Tag,getTagValue,new,20,public
From: https://blog.51cto.com/u_11979904/5982993

相关文章