Beispiel #1
0
 internal void OnMessage(InstrumentField field, bool completed)
 {
     if (QryInstrumentCompleted)
     {
         return;
     }
     if (field != null)
     {
         var inst = _convertor.GetInstument(field);
         switch (inst.Type)
         {
         case InstrumentType.Stock:
         case InstrumentType.Future:
         case InstrumentType.Option:
         case InstrumentType.FutureOption:
         case InstrumentType.MultiLeg:
             _instruments.Add(inst);
             break;
         }
     }
     if (completed)
     {
         _instruments.Sort((x, y) => string.Compare(x.Symbol, y.Symbol, StringComparison.Ordinal));
         QryInstrumentCompleted = true;
         Logger.Info($"合约查询完毕,收到{_instruments.Count}个合约");
         Logger.Info("开始查询资金和持仓......");
         Trader.QueryAccount();
         Trader.QueryPositions();
         StartTimerTask();
     }
 }
Beispiel #2
0
 private void ProcessTrace(string message)
 {
     if (message == "RtnTrade" && QueryTradingDataAfterTrade)
     {
         trader.QueryAccount();
         trader.QueryPositions();
     }
 }