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 | @RptID | | Unique identifier for the Trade Capture Report | | ||
1003 | @TrdID | | | | ||
1040 | @TrdID2 | | | | ||
1041 | @FirmTrdID | | | | ||
1042 | @FirmTrdID2 | | | | ||
487 | @TransTyp | | Identifies Trade Report message transaction type. | | ||
856 | @RptTyp | | Indicates action to take on trade | | ||
828 | @TrdTyp | | | | ||
829 | @TrdSubTyp | | | | ||
855 | @TrdTyp2 | | | | ||
1123 | @TrdHandlInst | | | | ||
1124 | @OrigTrdHandlInst | | | | ||
1125 | @OrigTrdDt | | Used to preserve original trade date when original trade is being referenced in a subsequent trade transaction such as a transfer | | ||
1126 | @OrigTrdID | | Used to preserve original trade id when original trade is being referenced in a subsequent trade transaction such as a transfer | | ||
1127 | @OrignTrdID2 | | Used to preserve original secondary trade id when original trade is being referenced in a subsequent trade transaction such as a transfer | | ||
830 | @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 | @ExecTyp | | Type of Execution being reported: Uses subset of ExecType for Trade Capture Reports | | ||
572 | @RptRefID | | The TradeReportID that is being referenced for some action, such as correction or cancellation | | ||
881 | @RptRefID2 | | The SecondaryTradeReportID that is being referenced for some action, such as correction or cancellation | FIX.5.0 | ||
939 | @TrdRptStat | | Status of Trade Report | | ||
751 | @RejRsn | | Reason for Rejection of Trade Report | | ||
818 | @RptID2 | | | FIX.5.0 | ||
263 | @SubReqTyp | | Used to subscribe / unsubscribe for trade capture reports If the field is absent, the value 0 will be the default | | ||
820 | @LinkID | | Used to associate a group of trades together. Useful for average price calculations. | | ||
880 | @MtchID | | | | ||
17 | ExecID | @ExecID | | Exchanged assigned Execution ID (Trade Identifier) | | |
527 | @ExecID2 | | | | ||
378 | @ExecRstmtRsn | | | | ||
570 | @PrevlyRpted | | | | ||
423 | @PxTyp | | | | ||
822 | @UndSesID | | | | ||
823 | @UndSesSub | | | | ||
716 | @SetSesID | | | | ||
717 | @SetSesSub | | | | ||
854 | @QtyTyp | | | | ||
32 | @LastQty | | | | ||
31 | LastPx | @LastPx | | | | |
1430 | @VenuTyp | | | | ||
1300 | @MktSegID | | | | ||
1301 | @MktID | | | |
Component | Instrument | Instrmt | Insert here the set of "Instrument" (symbology) fields defined in "Common Components of Application Messages" | |
669 | @LastParPx | | | | ||
1056 | @CalcCcyLastQty | | | | ||
1071 | @LastSwapPnts | | | | ||
15 | @Ccy | | Primary currency of the specified currency pair. Used to qualify LastQty and GrossTradeAmout | | ||
120 | @SettlCcy | | Contra currency of the deal. Used to qualify CalculatedCcyLastQty | | ||
194 | @LastSpotRt | | | | ||
195 | @LastFwdPnts | | | | ||
30 | @LastMkt | | | | ||
75 | @TrdDt | | | | ||
715 | @BizDt | | | | ||
6 | AvgPx | @AvgPx | | | | |
819 | @AvgPxInd | | | | ||
442 | @MLegRptTyp | | | | ||
824 | @TrdLegRefID | | | | ||
60 | @TxnTm | | Time ACK was issued by matching system, trading system or counterparty | | ||
63 | @SettlTyp | | | |
Component | UndInstrmtGrp | Undly | | | |
573 | @MtchStat | | | | ||
574 | @MtchTyp | | | | ||
797 | @CopyMsgInd | | | |
Component | TrdRepIndicatorsGrp | TrdRepIndicatorsGrp | | | |
852 | @PubTrdInd | | | FIX.5.0 | ||
1390 | @TrdPubInd | | | | ||
853 | @ShrtSaleRsn | | | |
Component | TrdInstrmtLegGrp | TrdLeg | | | |
Component | TrdRegTimestamps | TrdRegTS | | | |
725 | @RspTransportTyp | | Ability to specify whether the response to the request should be delivered inband or via pre-arranged out-of-band transport. | | ||
726 | @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 | @EncTxtLen | | Must be set if EncodedText field is specified and must immediately precede it. | | ||
355 | @EncTxt | | Encoded (non-ASCII characters) representation of the Text field in the encoded format specified via the MessageEncoding field. | | ||
1015 | @AsOfInd | | Indicates if the trade is an outtrade from a previous day | | ||
635 | @ClrFeeInd | | | |
Component | PositionAmountData | Amt | | Insert here here the set of "Position Amount Data" fields defined in "Common Components of Application Messages" | |
994 | @TierCD | | Indicates the algorithm (tier) used to match a trade | | ||
1011 | @MsgEvtSrc | | Used to identify the event or source which gave rise to a message | | ||
779 | @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 | @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 | @SettlDt | | | | ||
1329 | @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;
}
}
消息处理:略