您的位置:首页 > 其它

fix协议介绍19-交易报告(TradeCaptureReport )

2013-12-13 20:24 483 查看


FIX.5.0SP2 Message

TradeCaptureReport [type 'AE']

<TrdCaptRpt>

The Trade Capture Report message can be:

• Used to report trades between counterparties.

• Used to report trades to a trade matching system

• Can be sent unsolicited between counterparties.

• Sent as a reply to a Trade Capture Report Request.

• Can be used to report unmatched and matched trades.

Added FIX.4.3

Expand Components | Collapse Components
Field or ComponentField NameFIXML nameReq'dCommentsDepr.

ComponentStandardHeaderBaseHeader
MsgType = AE

ComponentApplicationSequenceControlApplSeqCtrl

571TradeReportID@RptIDTradeReportID is conditionally required in a message-chaining model in which a subsequent message may refer to a prior message via TradeReportRefID. The alternative to a message-chain model is an entity-based
model in which TradeID is used to identify a trade. In this case, TradeID is required and TradeReportID can be optionally specified.

1003TradeID@TrdID

1040SecondaryTradeID@TrdID2

1041FirmTradeID@FirmTrdID

1042SecondaryFirmTradeID@FirmTrdID2

487TradeReportTransType@TransTypIdentifies Trade Report message transaction type.

856TradeReportType@RptTyp

939TrdRptStatus@TrdRptStatStatus of Trade Report

In 3 party listed derivatives model used to convey status of a trade to a counterparty. Used specifically in a "claim" model.

568TradeRequestID@ReqIDRequest ID if the Trade Capture Report is in response to a Trade Capture Report Request

828TrdType@TrdTyp

829TrdSubType@TrdSubTyp

855SecondaryTrdType@TrdTyp2

1123TradeHandlingInstr@TrdHandlInst

1124OrigTradeHandlingInstr@OrigTrdHandlInst

1125OrigTradeDate@OrigTrdDtUsed to preserve original trade date when original trade is being referenced in a subsequent trade transaction such as a transfer

1126OrigTradeID@OrigTrdIDUsed to preserve original trade id when original trade is being referenced in a subsequent trade transaction such as a transfer

1127OrigSecondaryTradeID@OrignTrdID2Used to preserve original secondary trade id when original trade is being referenced in a subsequent trade transaction such as a transfer

830TransferReason@TrnsfrRsn

150ExecType@ExecTypType of Execution being reported:

Uses subset of ExecType for Trade Capture Reports

748TotNumTradeReports@TotNumTrdRptsNumber of trade reports returned - if this report is part of a response to a Trade Capture Report Request

912LastRptRequested@LastRptReqedIndicates if this is the last report in the response to a Trade Capture Report Request

325UnsolicitedIndicator@UnsolSet to 'Y' if message is sent as a result of a subscription request or out of band configuration as opposed to a Position Request.

263SubscriptionRequestType@SubReqTypUsed to subscribe / unsubscribe for trade capture reports. If the field is absent, the value 0 will be the default

572TradeReportRefID@RptRefIDThe TradeReportID that is being referenced for some action, such as correction or cancellation

881SecondaryTradeReportRefID@RptRefID2FIX.5.0

818SecondaryTradeReportID@RptID2FIX.5.0

820TradeLinkID@LinkIDUsed to associate a group of trades together. Useful for average price calculations.

880TrdMatchID@MtchID

17ExecID@ExecIDMarket (Exchange) assigned Execution Identifier

527SecondaryExecID@ExecID2

378ExecRestatementReason@ExecRstmtRsnReason for restatement

570PreviouslyReported@PrevlyRptedIndicates if the trade capture report was previously reported to the counterparty

423PriceType@PxTypCan be used to indicate cabinet trade pricing

ComponentRootPartiesPtyInsert here the set of "Root Parties" fields defined in "common components of application messages" Used for acting parties that applies to the whole message, not individual legs, sides, etc..

1015AsOfIndicator@AsOfIndIndicates if the trade is an outtrade from a previous day.

716SettlSessID@SetSesID

717SettlSessSubID@SetSesSub

1430VenueType@VenuTyp

1300MarketSegmentID@MktSegID

1301MarketID@MktID

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

ComponentFinancingDetailsFinDetlsInsert here the set of "FinancingDetails" fields defined in "Common Components of Application Messages"

854QtyType@QtyTyp

ComponentYieldDataYieldInsert here the set of "YieldData" fields defined in "Common Components of Application Messages"

ComponentUndInstrmtGrpUndly

822UnderlyingTradingSessionID@UndSesID

823UnderlyingTradingSessionSubID@UndSesSub

32LastQty@LastQty
Trade Quantity.

31LastPx@LastPx
Trade Price.

1056CalculatedCcyLastQty@CalcCcyLastQty

15Currency@CcyPrimary currency of the specified currency pair. Used to qualify LastQty and GrossTradeAmout

120SettlCurrency@SettlCcyContra currency of the deal. Used to qualify CalculatedCcyLastQty

669LastParPx@LastParPxLast price expressed in percent-of-par. Conditionally required for Fixed Income trades when LastPx is expressed in Yield, Spread, Discount or any other price type that is not percent-of-par.

194LastSpotRate@LastSpotRtApplicable for F/X orders

195LastForwardPoints@LastFwdPntsApplicable for F/X orders

1071LastSwapPoints@LastSwapPnts

30LastMkt@LastMkt

75TradeDate@TrdDtUsed when reporting other than current day trades.

715ClearingBusinessDate@BizDt

6AvgPx@AvgPxAverage Price - if present then the LastPx will contain the original price on the execution

ComponentSpreadOrBenchmarkCurveDataSprdBnchmkCurveInsert here the set of "SpreadOrBenchmarkCurveData" fields defined in "Common Components of Application Messages"

819AvgPxIndicator@AvgPxIndAverage Pricing indicator

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

442MultiLegReportingType@MLegRptTypType of report if multileg instrument.

Provided to support a scenario for trades of multileg instruments between two parties.

824TradeLegRefID@TrdLegRefIDReference to the leg of a multileg instrument to which this trade refers

Used when MultiLegReportingType = 2 (Single Leg of a Multileg security)

ComponentTrdInstrmtLegGrpTrdLegNumber of legs

Identifies a Multi-leg Execution if present and non-zero.

60TransactTime@TxnTmTime the transaction represented by this Trade Capture Report occurred. Execution Time of trade. Also describes the time of block trades.

ComponentTrdRegTimestampsTrdRegTS

63SettlType@SettlTyp

64SettlDate@SettlDtTakes precedence over SettlType value and conditionally required/omitted for specific SettlType values.

987UnderlyingSettlementDate@StlDtThe settlement date for the underlying instrument of a derivatives security.

573MatchStatus@MtchStat

574MatchType@MtchTyp

ComponentTrdCapRptSideGrpRptSide
Number of sides

1188Volatility@Vol

1380DividendYield@DividendYield

1190RiskFreeRate@RFR

1382CurrencyRatio@CurrencyRatio

797CopyMsgIndicator@CopyMsgIndIndicates drop copy.

ComponentTrdRepIndicatorsGrpTrdRepIndicatorsGrpNumber of trade reporting indicators following

852PublishTrdIndicator@PubTrdIndFIX.5.0

1390TradePublishIndicator@TrdPubInd

853ShortSaleReason@ShrtSaleRsn

994TierCode@TierCDIndicates the algorithm (tier) used to match a trade

1011MessageEventSource@MsgEvtSrcUsed to identify the event or source which gave rise to a message

779LastUpdateTime@LastUpdateTmUsed to indicate reports after a specific time

991RndPx@RndPxSpecifies the rounded price to quoted precision.

1132TZTransactTime@TZTransactTime

1134ReportedPxDiff@ReportedPxDiffThe reason(s) for the price difference should be stated by using field (Tag 828 ) TrdType and, if required, field (Tag 829) TrdSubType as well

381GrossTradeAmt@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.

1328RejectText@RejTxt

1329FeeMultiplier@FeeMult

ComponentStandardTrailer
© 2007 - 2012 FIX Protocol Limited
Contact us
Copyright and Acceptable Use policy
Privacy Policy

消息实现:

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 TradeCaptureReportMsg extends BaseMsg {
private Tag tradeReportID=new Tag("571","String",false);
private Tag tradeReportTransType=new Tag("487","int",false);
private Tag tradeReportType=new Tag("856","int",false);
private Tag trdType=new Tag("828","int",false);
private Tag tradeHandlingInstr=new Tag("1123","char",false);
private Tag lastPx=new Tag("31","Price",true);
private Tag lastQty=new Tag("32","Qty",true);
private Tag transactTime = new Tag("60", "UTCTimestamp", false);
private Tag trdCapRptSideGrp=new TrdCapRptSideGrpTag(true);
private Tag instrument = new InstrumentTag(true);
private Tag exchangeTradeType=new Tag("5681","char",false);
private Tag execType=new Tag("150","char",false);
private Tag tradeID=new Tag("1003","String",false);
private Tag trdRptStatus=new Tag("939","int",false);

private Set<String> tagIdsSet = new HashSet<String>();
public TradeCaptureReportMsg(){
this.getHeadEntity().getMsgType().setTagValue("AE");
tagIdsSet.add("571");
tagIdsSet.add("487");
tagIdsSet.add("856");
tagIdsSet.add("828");
tagIdsSet.add("1123");
tagIdsSet.add("31");
tagIdsSet.add("32");
tagIdsSet.add("60");
tagIdsSet.add("5681");
tagIdsSet.add("150");
tagIdsSet.add("1003");
tagIdsSet.add("939");
this.bodyEntity.getBodyTagList().add(tradeReportID);
this.bodyEntity.getBodyTagList().add(tradeReportTransType);
this.bodyEntity.getBodyTagList().add(tradeReportType);
this.bodyEntity.getBodyTagList().add(trdType);
this.bodyEntity.getBodyTagList().add(tradeHandlingInstr);
this.bodyEntity.getBodyTagList().add(lastPx);
this.bodyEntity.getBodyTagList().add(lastQty);
this.bodyEntity.getBodyTagList().add(transactTime);
this.bodyEntity.getBodyTagList().add(trdCapRptSideGrp);
this.bodyEntity.getBodyTagList().add(instrument);
this.bodyEntity.getBodyTagList().add(exchangeTradeType);
this.bodyEntity.getBodyTagList().add(execType);
this.bodyEntity.getBodyTagList().add(tradeID);
this.bodyEntity.getBodyTagList().add(trdRptStatus);
}

@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 (trdType.getTagValue() != null) {
if (!(Integer.parseInt(trdType.getTagValue()) >= 0 && Integer
.parseInt(trdType.getTagValue()) <= 55)) {
throw new InValidDataException("trdType错误["
+ trdType.getTagId() + "=" + trdType.getTagValue()
+ "]");
}
}
if(tradeHandlingInstr.getTagValue()!=null){
if(!MsgUtil.tradeHandlingInstr.contains(tradeHandlingInstr.getTagValue())){
throw new InValidDataException("tradeHandlingInstr错误["
+ tradeHandlingInstr.getTagId() + "=" + tradeHandlingInstr.getTagValue()
+ "]");
}
}
if(exchangeTradeType.getTagValue()!=null){
if(!MsgUtil.exchangeTradeType.contains(exchangeTradeType.getTagValue())){
throw new InValidDataException("exchangeTradeType错误["
+ exchangeTradeType.getTagId() + "=" + exchangeTradeType.getTagValue()
+ "]");
}
}
if(execType.getTagValue()!=null){
if(!MsgUtil.execType.contains(execType.getTagValue())){
throw new InValidDataException("execType错误["
+ execType.getTagId() + "=" + execType.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()
+ "]");
}
}
}

public Tag getTradeReportID() {
return tradeReportID;
}

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

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 getTrdType() {
return trdType;
}

public void setTrdType(Tag trdType) {
this.trdType = trdType;
}

public Tag getTradeHandlingInstr() {
return tradeHandlingInstr;
}

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

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 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 Set<String> getTagIdsSet() {
return tagIdsSet;
}

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

public Tag getExchangeTradeType() {
return exchangeTradeType;
}

public void setExchangeTradeType(Tag exchangeTradeType) {
this.exchangeTradeType = exchangeTradeType;
}

public Tag getExecType() {
return execType;
}

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

public Tag getTradeID() {
return tradeID;
}

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

public Tag getTrdRptStatus() {
return trdRptStatus;
}

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

}


处理逻辑:略
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: