Пример #1
0
 public ProcessLmtOrder()
 {
     this._OrderTasks = new ObservableCollection<OrderTask>();
     this._LmtOrderForInstrument = new LmtOrderForInstrument();
 }
Пример #2
0
        public void OnOrderUpdate(OrderTask orderTask,LmtOrderForInstrument currentInstrument)
        {
            if(orderTask.Transaction.OrderType == OrderType.Limit || orderTask.Transaction.OrderType == OrderType.Market)
            {
                if (orderTask.OrderStatus == OrderStatus.WaitOutLotLMT || orderTask.OrderStatus == OrderStatus.WaitOutLotLMTOrigin)
                {
                    InstrumentClient instrument = orderTask.Instrument;
                    if (instrument.IsNormal ^ (orderTask.IsBuy == BuySell.Buy))
                        orderTask.BestPrice = currentInstrument.Bid;
                    else
                        orderTask.BestPrice = currentInstrument.Ask;

                    if (orderTask.Transaction.OrderType == OrderType.Limit)
                        orderTask.SetPrice = orderTask.BestPrice;
                }
            }
        }