Пример #1
0
        public override void Refresh()
        {
            CheckRunningStatus();
            CommonProc.SynchroniseList <IMarketData>(TargetProject.MarketDataList, MarketDataList);
            //CommonProc.SynchroniseList<IIndicatorValue>(TargetProject.IndicatorDataList, IndicatorDataList);
            CommonProc.SynchroniseList <IOrder>(TargetProject.OrderList, OrderList);
            CommonProc.SynchroniseList <TimeValueObject>(TargetProject.CurrentValueList, CurrentValueList);
            CommonProc.SynchroniseList <TimeValueObject>(TargetProject.StandardValueList, StandardValueList);
            if (CurrentInstrument == null && InstrumentList.Count > 0)
            {
                CurrentInstrument = InstrumentList.FirstOrDefault();
            }
            if (CurrentInstrument != null)
            {
                var l = MarketDataList.Where(v => v.InstrumentTicker == CurrentInstrument.Ticker);
                CommonProc.SynchroniseList <IMarketData>(l, CurrentInstrumentMarketDataList);
                var ol = OrderList.Where(v => v.Ticker == CurrentInstrument.Ticker);
                CommonProc.SynchroniseList <IOrder>(ol, CurrentInstrumentOrderList);
            }

            TestCurrentTime = TargetProject.TestCurrentTime;
            OnPropertyChanged("CurrentValue");
            OnPropertyChanged("Pnl");
            OnPropertyChanged("StatusPnl");
            OnPropertyChanged("Efficiency");
            OnPropertyChanged("MaxLost");
            refreshChartAxis();
            OnPropertyChanged("CanStart");
            OnPropertyChanged("CanPause");
            OnPropertyChanged("CanStop");
            OnPropertyChanged("FinishPercent");
            if (TargetSummaryVM != null)
            {
                TargetSummaryVM.Refresh();
            }
            OnPropertyChanged("CanStart");
            OnPropertyChanged("CanPause");
            OnPropertyChanged("CanStop");
            OnPropertyChanged("TestCurrentTimeInfo");
            base.Refresh();
        }