fix协议介绍16-查询叮当(quote)

35 篇文章 0 订阅
34 篇文章 16 订阅

FIX.5.0SP2 Message

Quote [type 'S']

<Quot>

The Quote message is used as the response to a Quote Request or a Quote Response message in both indicative, tradeable, and restricted tradeable quoting markets.


Added  FIX.4.0

Expand Components | Collapse Components

  Field or Component Field Name FIXML name Req'd Comments Depr.
Component StandardHeader BaseHeader

MsgType = S

 
131 QuoteReqID @ReqID  

Required when quote is in response to a Quote Request message

 
117 QuoteID @QID    
1166 QuoteMsgID @QtMsgID  

Optionally used to supply a message identifier for a quote.

 
693 QuoteRespID @RspID  

Required when responding to the Quote Response message. The counterparty specified ID of the Quote Response message.

 
537 QuoteType @Typ  

Quote Type

If not specified, the default is an indicative quote

 
1171 PrivateQuote @PrvtQt  

Used to indicate whether a private negotiation is requested or if the response should be public. Only relevant in markets supporting both Private and Public quotes. If field is not provided in message, the model used must be bilaterally agreed.

 
Component QuotQualGrp QuotQual      
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"

 
336 TradingSessionID @SesID      
625 TradingSessionSubID @SesSub      
Component Instrument Instrmt

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

 
Component FinancingDetails FinDetls  

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

 
Component UndInstrmtGrp Undly  

Number of underlyings

 
54 Side @Side  

Required for Tradeable or Counter quotes of single instruments

 
Component OrderQtyData OrdQty  

Required for Tradeable quotes or Counter quotes of single instruments

 
63 SettlType @SettlTyp      
64 SettlDate @SettlDt  

Can be used with forex quotes to specify a specific "value date".

For NDFs this is required.

 
193 SettlDate2 @SettlDt2  

Can be used with OrdType = "Forex - Swap" to specify the "value date" for the future portion of a F/X swap.

FIX.5.0
192 OrderQty2 @Qty2  

Can be used with OrdType = "Forex - Swap" to specify the order quantity for the future portion of a F/X swap.

FIX.5.0
15 Currency @Ccy  

Can be used to specify the currency of the quoted prices. May differ from the 'normal' trading currency of the instrument being quoted

 
120 SettlCurrency @SettlCcy  

Required for NDFs to specify the settlement currency (fixing currency).

 
Component RateSource RtSrc      
Component Stipulations Stip  

Insert here the set of "Stipulations" (repeating group of Fixed Income stipulations) fields defined in "Common Components of Application Messages"

 
1 Account @Acct      
660 AcctIDSource @AcctIDSrc      
581 AccountType @AcctTyp  

Type of account associated with the order (Origin)

 
Component LegQuotGrp Quot  

Required for multileg quotes

 
132 BidPx @BidPx  

If F/X quote, should be the "all-in" rate (spot rate adjusted for forward points). Note that either BidPx, OfferPx or both must be specified.

 
133 OfferPx @OfrPx  

If F/X quote, should be the "all-in" rate (spot rate adjusted for forward points). Note that either BidPx, OfferPx or both must be specified.

 
645 MktBidPx @MktBidPx  

Can be used by markets that require showing the current best bid and offer

 
646 MktOfferPx @MktOfrPx  

Can be used by markets that require showing the current best bid and offer

 
647 MinBidSize @MinBidSz  

Specifies the minimum bid size. Used for markets that use a minimum and maximum bid size.

 
134 BidSize @BidSz  

Specifies the bid size. If MinBidSize is specified, BidSize is interpreted to contain the maximum bid size.

 
648 MinOfferSize @MinOfrSz  

Specifies the minimum offer size. If MinOfferSize is specified, OfferSize is interpreted to contain the maximum offer size.

 
135 OfferSize @OfrSz  

Specified the offer size. If MinOfferSize is specified, OfferSize is interpreted to contain the maximum offer size.

 
110 MinQty @MinQty  

For use in private/directed quote negotiations.

 
62 ValidUntilTime @ValidUntilTm  

The time when the quote will expire

 
188 BidSpotRate @BidSpotRt  

May be applicable for F/X quotes

 
190 OfferSpotRate @OfrSpotRt  

May be applicable for F/X quotes

 
189 BidForwardPoints @BidFwdPnts  

May be applicable for F/X quotes

 
191 OfferForwardPoints @OfrFwdPnts  

May be applicable for F/X quotes

 
1065 BidSwapPoints @BidSwapPnts  

Bid swap points of an FX Swap quote.

 
1066 OfferSwapPoints @OfrSwapPnts      
631 MidPx @MidPx      
632 BidYield @BidYld      
633 MidYield @MidYld      
634 OfferYield @OfrYld      
60 TransactTime @TxnTm      
40 OrdType @OrdTyp  

Can be used to specify the type of order the quote is for

 
642 BidForwardPoints2 @BidFwdPnts2  

Bid F/X forward points of the future portion of a F/X swap quote added to spot rate. May be a negative value

FIX.5.0
643 OfferForwardPoints2 @OfrFwdPnts2  

Offer F/X forward points of the future portion of a F/X swap quote added to spot rate. May be a negative value

FIX.5.0
656 SettlCurrBidFxRate @SettlCurrBidFxRt  

Can be used when the quote is provided in a currency other than the instrument's 'normal' trading currency. Applies to all bid prices contained in this quote message

 
657 SettlCurrOfferFxRate @SettlCurrOfrFxRt  

Can be used when the quote is provided in a currency other than the instrument's 'normal' trading currency. Applies to all offer prices contained in this quote message

 
156 SettlCurrFxRateCalc @SettlCurrFxRtCalc  

Can be used when the quote is provided in a currency other than the instruments trading currency.

 
13 CommType @CommTyp  

Can be used to show the counterparty the commission associated with the transaction.

 
12 Commission @Comm  

Can be used to show the counterparty the commission associated with the transaction.

 
582 CustOrderCapacity @CustCpcty  

For Futures Exchanges

 
100 ExDestination @ExDest  

Used when routing quotes to multiple markets

 
1133 ExDestinationIDSource @ExDestIDSrc      
775 BookingType @BkngTyp      
528 OrderCapacity @Cpcty      
529 OrderRestrictions @Rstctions      
423 PriceType @PxTyp      
Component SpreadOrBenchmarkCurveData SprdBnchmkCurve      
Component YieldData Yield      
58 Text @Txt      
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.

 
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-11-30
 */
public class QuoteMsg extends BaseMsg {
	private Tag parties = new PartiesTag(false);
	private Tag instrument = new InstrumentTag(true);
	private Tag bidID = new Tag("390", "String", false);
	private Tag offerID = new Tag("1867", "String", false);
	private Tag quoteType = new Tag("537", "int", false);
	private Tag side = new Tag("54", "char", false);
	private Tag bidSize = new Tag("134", "Qty", false);
	private Tag offerSize = new Tag("135", "Qty", false);
	private Tag bidPx = new Tag("132", "Price", false);
	private Tag offerPx = new Tag("133", "Price", false);
	private Tag transactTime = new Tag("60", "UTCTimestamp", true);
	private Tag positionEffect = new Tag("77", "char", false);
	private Tag orderRestrictions = new Tag("529", "MultipleCharValue", false);
	private Tag text = new Tag("58", "String", false);
	private Tag valueChecksGrp = new ValueChecksGrpTag(false);

	private Set<String> tagIdsSet = new HashSet<String>();

	public QuoteMsg() {
		this.getHeadEntity().getMsgType().setTagValue("S");
		tagIdsSet.add("390");
		tagIdsSet.add("1867");
		tagIdsSet.add("537");
		tagIdsSet.add("54");
		tagIdsSet.add("134");
		tagIdsSet.add("135");
		tagIdsSet.add("132");
		tagIdsSet.add("133");
		tagIdsSet.add("60");
		tagIdsSet.add("77");
		tagIdsSet.add("529");
		tagIdsSet.add("58");
		this.bodyEntity.getBodyTagList().add(parties);
		this.bodyEntity.getBodyTagList().add(instrument);
		this.bodyEntity.getBodyTagList().add(bidID);
		this.bodyEntity.getBodyTagList().add(offerID);
		this.bodyEntity.getBodyTagList().add(quoteType);
		this.bodyEntity.getBodyTagList().add(side);
		this.bodyEntity.getBodyTagList().add(bidSize);
		this.bodyEntity.getBodyTagList().add(offerSize);
		this.bodyEntity.getBodyTagList().add(bidPx);
		this.bodyEntity.getBodyTagList().add(offerPx);
		this.bodyEntity.getBodyTagList().add(transactTime);
		this.bodyEntity.getBodyTagList().add(positionEffect);
		this.bodyEntity.getBodyTagList().add(orderRestrictions);
		this.bodyEntity.getBodyTagList().add(text);
		this.bodyEntity.getBodyTagList().add(valueChecksGrp);
	}

	@Override
	public void decodeBody() {

	}

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

	public Tag getParties() {
		return parties;
	}

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

	public Tag getInstrument() {
		return instrument;
	}

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

	public Tag getBidID() {
		return bidID;
	}

	public void setBidID(Tag bidID) {
		this.bidID = bidID;
	}

	public Tag getOfferID() {
		return offerID;
	}

	public void setOfferID(Tag offerID) {
		this.offerID = offerID;
	}

	public Tag getQuoteType() {
		return quoteType;
	}

	public void setQuoteType(Tag quoteType) {
		this.quoteType = quoteType;
	}

	public Tag getSide() {
		return side;
	}

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

	public Tag getBidSize() {
		return bidSize;
	}

	public void setBidSize(Tag bidSize) {
		this.bidSize = bidSize;
	}

	public Tag getOfferSize() {
		return offerSize;
	}

	public void setOfferSize(Tag offerSize) {
		this.offerSize = offerSize;
	}

	public Tag getBidPx() {
		return bidPx;
	}

	public void setBidPx(Tag bidPx) {
		this.bidPx = bidPx;
	}

	public Tag getOfferPx() {
		return offerPx;
	}

	public void setOfferPx(Tag offerPx) {
		this.offerPx = offerPx;
	}

	public Tag getTransactTime() {
		return transactTime;
	}

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

	public Tag getPositionEffect() {
		return positionEffect;
	}

	public void setPositionEffect(Tag positionEffect) {
		this.positionEffect = positionEffect;
	}

	public Tag getOrderRestrictions() {
		return orderRestrictions;
	}

	public void setOrderRestrictions(Tag orderRestrictions) {
		this.orderRestrictions = orderRestrictions;
	}

	public Tag getText() {
		return text;
	}

	public void setText(Tag text) {
		this.text = text;
	}

	public Tag getValueChecksGrp() {
		return valueChecksGrp;
	}

	public void setValueChecksGrp(Tag valueChecksGrp) {
		this.valueChecksGrp = valueChecksGrp;
	}

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

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

}

消息处理:略




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hxpjava1

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值