private void ProcessRtnTrade(CtpTrade data)
        {
            var sysId = $"{data.ExchangeID}:{data.InstrumentID}:{data.OrderSysID}";

            if (_orders.TryGetBySysId(sysId, out var order))
            {
                var trade = CtpConvert.GetTrade(data);
                trade.ID = order.ID;
                _client.Spi.ProcessRtnTrade(trade);
            }
        }
 private void ProcessRtnTrade(CtpTrade data)
 {
     if (_orders.TryGetBySysId(data.OrderSysID, out var order))
     {
         var trade = CtpConvert.GetTrade(data);
         trade.ID = order.ID;
         _client.Spi.ProcessRtnTrade(trade);
     }
     else
     {
         _tradePendings.Add(data);
     }
 }
 private void ProcessRtnTrade(CtpTrade data)
 {
     _client.spi.ProcessLog(new LogField(LogLevel.Trace, "RtnTrade"));
     if (_orders.TryGetBySysId(data.OrderSysID, out var order))
     {
         var trade = CtpConvert.GetTrade(data);
         trade.ID = order.ID;
         _client.spi.ProcessRtnTrade(trade);
     }
     else
     {
         _tradePending.Add(data);
     }
 }
Esempio n. 4
0
        protected override bool ProcessTrade(CtpResponse?rsp)
        {
            if (rsp == null)
            {
                return(true);
            }

            if (CtpConvert.CheckRspInfo(rsp.Value.Item2))
            {
                _client.spi.ProcessQryTrade(CtpConvert.GetTrade(rsp.Value.Item1.AsTrade), rsp.Value.IsLast);
                return(rsp.Value.IsLast);
            }

            return(true);
        }