private void OnRspQryTrade_callback(object sender, ref TradeField trade, int size1, bool bIsLast) { if (size1 <= 0) { (sender as XApi).GetLog().Info("OnRspQryTrade"); return; } (sender as XApi).GetLog().Info("OnRspQryTrade:" + trade.ToFormattedString()); }
private void OnRtnTrade_callback(object sender, ref TradeField trade) { (sender as XApi).GetLog().Debug("OnRtnTrade:" + trade.ToFormattedString()); try { orderMap.Process(ref trade); } catch (Exception ex) { (sender as XApi).GetLog().Error(ex); } }
private void OnRspQryTrade_callback(object sender, ref TradeField trade, int size1, bool bIsLast) { if (size1 <= 0) { (sender as XApi).GetLog().Info("OnRspQryTrade"); } else { (sender as XApi).GetLog().Info("OnRspQryTrade:" + trade.ToFormattedString()); } if (OnRspQryTrade != null) { OnRspQryTrade(this, ref trade, size1, bIsLast); } }
private void OnRtnTrade_callback(object sender, ref TradeField trade) { lock (this) { var log = (sender as XApi).GetLog(); log.Debug("OnRtnTrade:" + trade.ToFormattedString()); // 由策略来收回报 if (OnRtnTrade != null) { OnRtnTrade(sender, ref trade); } try { orderMap.Process(ref trade, log); } catch (Exception ex) { log.Error(ex); } } }