public StrategyRunResultsViewModel() { _dispatcher = Dispatcher.CurrentDispatcher; ChartViewModel = new ChartViewModel(); ((INotifyPropertyChanged)ChartViewModel).PropertyChanged += ChartViewModelPropertyChanged; TradesViewModel = new TradeListViewModel(); ChartViewModel.ChartTimeframe = Timeframe.H4; DependencyContainer.ComposeParts(this); _uiService.ViewTradeObservable.Subscribe(o => { if (TradesViewModel.SelectedTrade == null) { return; } if (TradesViewModel.SelectedTrade.Timeframe != null) { ChartViewModel.ChartTimeframe = TradesViewModel.SelectedTrade.Timeframe.Value; } ChartViewModel.ShowTrade(TradesViewModel.SelectedTrade, ChartViewModel.ChartTimeframeOptions[ChartViewModel.SelectedChartTimeframeIndex], false, s => { }, new List <(IIndicator Indicator, Color Color, bool ShowInLegend)>() { (new ExponentialMovingAverage(8), Colors.DarkBlue, true), (new ExponentialMovingAverage(25), Colors.Blue, true), (new ExponentialMovingAverage(50), Colors.Blue, true), (new BollingerBand(1.5F, 20), Colors.Green, true), (new BollingerBand(-1.5F, 20), Colors.Green, false) }, _uiService.UseHeikenAshi); }); ResultsViewModel = new TradesResultsViewModel(() => { lock (_results.Results) { return(_results.Results.ToList()); } }); _testResultsStartedObserver = _results.TestRunStarted.Subscribe(newResults => { UpdateTrades(); ResultsViewModel.UpdateResults(); }); _testResultsUpdatedObserver = _results.TestRunCompleted.Subscribe(newResults => { UpdateTrades(); ResultsViewModel.UpdateResults(); }); Task.Run(() => { Log.Info("Updating strategy run results"); UpdateTrades(); ResultsViewModel.UpdateResults(); Log.Info("Updated strategy run results"); }); TradesViewModel.ShowClosedTrades = true; TradesViewModel.ShowOpenTrades = true; TradesViewModel.ShowOrders = true; }