예제 #1
0
        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);
        }
예제 #2
0
 /// <summary>
 ///报价录入请求
 /// </summary>
 public int ReqQuoteInsert(ThostFtdcInputQuoteField pInputQuote, int nRequestID)
 {
     return(Interop.TdReqQuoteInsert(Handle, pInputQuote, nRequestID));
 }
예제 #3
0
 public static extern int TdReqQuoteInsert(IntPtr pApi, ThostFtdcInputQuoteField pInputQuote, int nRequestID);
예제 #4
0
 /// <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)
 {
 }
예제 #5
0
 /// <summary>
 /// 报价录入错误回报
 /// </summary>
 /// <param name="pInputQuote"></param>
 /// <param name="pRspInfo"></param>
 void OnErrRtnQuoteInsert(ThostFtdcInputQuoteField pInputQuote, ThostFtdcRspInfoField pRspInfo)
 {
 }
예제 #6
0
        /// <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;
        }