Beispiel #1
0
 private void OnRspQryInstrument(IntPtr pTraderApi, ref CThostFtdcInstrumentField pInstrument, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     if (0 == pRspInfo.ErrorID)
     {
         _dictInstruments[pInstrument.InstrumentID] = pInstrument;
         if (bIsLast)
         {
             Console.WriteLine(string.Format("TdApi:{0},合约列表已经接收完成",
                 Clock.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")));
         }
     }
     else
         EmitError(nRequestID, pRspInfo.ErrorID, "OnRspQryInstrument:" + pRspInfo.ErrorMsg);
 }
 private static int SortCThostFtdcInstrumentField(CThostFtdcInstrumentField a1, CThostFtdcInstrumentField a2)
 {
     return a1.InstrumentID.CompareTo(a2.InstrumentID);
 }