예제 #1
0
        public void From(string ordRef, PTEntity.Order order)
        {
            int idx = Array.FindIndex(LastOrder.Legs,
                                      l => l.InstrumentID == order.InstrumentID &&
                                      l.Direction == order.Direction);

            if (idx > -1)
            {
                LastOrder.Legs[idx] = order;

                foreach (var oVm in _orders)
                {
                    if (oVm.OrderUid == OrderVM.GetOrderUid(order))
                    {
                        oVm.From(order);
                        break;
                    }
                }

                // updating the second leg order
                bool allFinished = false;
                foreach (var oVm in _orders)
                {
                    allFinished = oVm.IsFinished;
                }
                IsAllFinished = allFinished;
                IsCanceled    = ("高频" == Reason ? CheckMlOrderCanceled(_orders) : String.Empty);
            }
        }
예제 #2
0
        public void From(string ordRef, trade.Order order)
        {
            int idx = LastOrder.Legs.FindIndex(
                l => l.InstrumentID == order.InstrumentID &&
                l.Direction == order.Direction);

            if (idx > -1)
            {
                LastOrder.Legs[idx] = order;

                foreach (var oVm in _orders)
                {
                    if (oVm.OrderUid == OrderVM.GetOrderUid(order))
                    {
                        oVm.From(order);
                        break;
                    }
                }
            }
        }