private static void QryInstrumentDepthMarketData(TraderAdapter trader)
        {
            try
            {
                foreach (var kv in Utils.InstrumentToInstrumentInfo)
                {
                    Thread.Sleep(1000);

                    Utils.WriteLine(string.Format("查询{0}...", kv.Key));

                    var ins = new ThostFtdcQryDepthMarketDataField
                    {
                        InstrumentID = kv.Key
                    };

                    trader.ReqQryDepthMarketData(ins, TraderAdapter.RequestId++);
                }

                Utils.WriteLine("查询合约详情完毕!!!");

                Thread.Sleep(1000);
            }
            catch (Exception ex)
            {
                Utils.WriteException(ex);
            }
        }
예제 #2
0
 private void btnQryMktData_Click(object sender, EventArgs e)
 {
     if (TraderApi != null && !string.IsNullOrEmpty(txtQryMktData.Text))
     {
         var req = new ThostFtdcQryDepthMarketDataField();
         req.InstrumentID = txtQryMktData.Text;
         req.ExchangeID   = "";
         TraderApi.ReqQryDepthMarketData(req, ++this.iRequestID);
     }
 }
예제 #3
0
 /// <summary>
 ///请求查询行情
 /// </summary>
 public int ReqQryDepthMarketData(ThostFtdcQryDepthMarketDataField pQryDepthMarketData, int nRequestID)
 {
     return(Interop.TdReqQryDepthMarketData(Handle, pQryDepthMarketData, nRequestID));
 }
예제 #4
0
 public static extern int TdReqQryDepthMarketData(IntPtr pApi, ThostFtdcQryDepthMarketDataField pQryDepthMarketData, int nRequestID);
예제 #5
0
        /// <summary>
        /// 请求查询行情
        /// </summary>
        void ReqQryDepthMarketData()
        {
            ThostFtdcQryDepthMarketDataField req = new ThostFtdcQryDepthMarketDataField();
            req.InstrumentID = INSTRUMENT_ID;

            int iResult = api.ReqQryDepthMarketData(req, ++iRequestID);
            Console.WriteLine("--->>> 请求查询行情: " + ((iResult == 0) ? "成功" : "失败"));
        }