/// <summary> /// 触发成交回报变更事件。 /// </summary> /// <param name="args"></param> protected virtual void FireTradeBookChanged(USeTradeBook tradeBook, bool isNew) { if (tradeBook == null) { return; } USeTradeBookChangedEventArgs args = new USeTradeBookChangedEventArgs(tradeBook, isNew); Debug.WriteLine(string.Format("[{0}] trade book changed,[TradeNum:{1}].", ToString(), args.TradeBook.TradeNum)); EventHandler <USeTradeBookChangedEventArgs> handel = this.OnTradeBookChanged; if (handel != null) { try { handel(this, args); } catch (Exception ex) { Debug.Assert(false, ex.Message); } } }
public USeTradeBook Clone() { USeTradeBook tradeBook = new USeTradeBook(); tradeBook.TradeNum = this.TradeNum; tradeBook.Instrument = this.Instrument == null ? null : this.Instrument.Clone(); tradeBook.OrderNum = this.OrderNum == null ? null : this.OrderNum.Clone(); tradeBook.OrderSide = this.OrderSide; tradeBook.OffsetType = this.OffsetType; tradeBook.Price = this.Price; tradeBook.Qty = this.Qty; tradeBook.Amount = this.Amount; tradeBook.Fee = this.Fee; tradeBook.TradeTime = this.TradeTime; tradeBook.Account = this.Account; return(tradeBook); }
/// <summary> /// 构造USeTradeBookChangedEventArgs实例。 /// </summary> /// <param name="tradeBook">成交回报。</param> public USeTradeBookChangedEventArgs(USeTradeBook tradeBook, bool isNew) { this.TradeBook = tradeBook; this.IsNew = isNew; }