public bool ReqQuoteInsert(CustomQuote quote, out string errMsg) { ThostFtdcInputQuoteField req = new ThostFtdcInputQuoteField(); req.BrokerID = BROKER_ID; req.InvestorID = INVESTOR_ID; req.QuoteRef = QUOTE_REF; req.InstrumentID = quote.InstrumentID; req.AskPrice = quote.AskPrice; req.BidPrice = quote.BidPrice; req.AskVolume = quote.AskVolume; req.BidVolume = quote.BidVolume; req.AskOffsetFlag = quote.AskOffsetFlag; req.BidOffsetFlag = quote.BidOffsetFlag; req.AskHedgeFlag = quote.AskHedgeFlag; req.BidHedgeFlag = quote.BidHedgeFlag; int ret = trader.ReqQuoteInsert(req, iRequestID++); errMsg = (ret == 0) ? "-" : "CTP询价回应录入失败,返回值:" + ret; return(ret == 0); }
/// <summary> ///报价录入请求 /// </summary> public int ReqQuoteInsert(ThostFtdcInputQuoteField pInputQuote, int nRequestID) { return(Interop.TdReqQuoteInsert(Handle, pInputQuote, nRequestID)); }
public static extern int TdReqQuoteInsert(IntPtr pApi, ThostFtdcInputQuoteField pInputQuote, int nRequestID);
/// <summary> /// 报价录入请求响应 /// </summary> /// <param name="pInputQuote"></param> /// <param name="pRspInfo"></param> /// <param name="nRequestID"></param> /// <param name="bIsLast"></param> void OnRspQuoteInsert(ThostFtdcInputQuoteField pInputQuote, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { }
/// <summary> /// 报价录入错误回报 /// </summary> /// <param name="pInputQuote"></param> /// <param name="pRspInfo"></param> void OnErrRtnQuoteInsert(ThostFtdcInputQuoteField pInputQuote, ThostFtdcRspInfoField pRspInfo) { }
/// <summary> /// 报价录入请求 /// </summary> public string PlaceQuote(object sender, string instrumentID, EnumOffsetFlagType AskOffset, int Asklots, double Askprice, EnumOffsetFlagType BidOffset, int Bidlots, double Bidprice) { ThostFtdcInputQuoteField req = new ThostFtdcInputQuoteField(); req.BrokerID = trader.BrokerID; req.InvestorID = trader.InvestorID; req.InstrumentID = instrumentID; req.AskHedgeFlag = EnumHedgeFlagType.Speculation; req.AskOffsetFlag = AskOffset; req.AskPrice = Askprice; req.AskVolume = Asklots; req.BidHedgeFlag = EnumHedgeFlagType.Speculation; req.BidOffsetFlag = BidOffset; req.BidPrice = Bidprice; req.BidVolume = Bidlots; QuoteRef++; req.QuoteRef = QuoteRef.ToString(); int iRet = trader.ReqQuoteInsert(req, ++RequestID); //QuoteRef2QuoteStategyMap.Add(req.QuoteRef, (Quote)sender); return req.QuoteRef; }