Beispiel #1
0
        /// <summary>
        /// 触发委托回报变更事件。
        /// </summary>
        /// <param name="args"></param>
        protected virtual void FireOrderBookChanged(USeOrderBook orderBook)
        {
            if (orderBook == null)
            {
                return;
            }

            USeOrderBookChangedEventArgs args = new USeOrderBookChangedEventArgs(orderBook);

            Debug.WriteLine(string.Format("[{0}] order book changed,[OrderNum:{1}],[TradeQty:{2}][TradePrice:{3}][TradeAmount:{4}][OrderState:{5}]",
                                          ToString(), args.OrderBook.OrderNum.ToString(), args.OrderBook.TradeQty,
                                          args.OrderBook.TradePrice, args.OrderBook.TradeAmount, args.OrderBook.OrderStatus));

            EventHandler <USeOrderBookChangedEventArgs> handel = this.OnOrderBookChanged;

            if (handel != null)
            {
                handel(this, args);
            }
        }
Beispiel #2
0
        public USeOrderBook Clone()
        {
            USeOrderBook orderBook = new USeOrderBook();

            orderBook.OrderNum    = this.OrderNum;
            orderBook.Account     = this.Account;
            orderBook.Instrument  = this.Instrument.Clone();
            orderBook.OrderQty    = this.OrderQty;
            orderBook.OrderPrice  = this.OrderPrice;
            orderBook.TradeQty    = this.TradeQty;
            orderBook.TradeAmount = this.TradeAmount;
            orderBook.TradePrice  = this.TradePrice;
            orderBook.TradeFee    = this.TradeFee;
            orderBook.OrderStatus = this.OrderStatus;
            orderBook.CancelQty   = this.CancelQty;
            orderBook.OrderSide   = this.OrderSide;
            orderBook.OffsetType  = this.OffsetType;
            orderBook.Memo        = this.Memo;
            orderBook.OrderTime   = this.OrderTime;

            return(orderBook);
        }
Beispiel #3
0
 /// <summary>
 /// 构造OrderBookEventArgs实例。
 /// </summary>
 /// <param name="orderBook">委托回报。</param>
 public USeOrderBookChangedEventArgs(USeOrderBook orderBook)
 {
     this.OrderBook = orderBook;
 }