public ChartWindow(CandleSeries candleSeries) { InitializeComponent(); if (candleSeries.IsNull()) throw new ArgumentNullException("candleSeries"); _candleSeries = candleSeries; _trader = MainWindow.Instance.Trader; Chart.ChartTheme = "ExpressionDark"; var area = new ChartArea(); Chart.Areas.Add(area); _candleElem = new ChartCandleElement { Antialiasing = false, UpFillColor = Colors.White, UpBorderColor = Colors.Black, DownFillColor = Colors.Black, DownBorderColor = Colors.Black, }; area.Elements.Add(_candleElem); _trader.NewCandles += ProcessNewCandles; _trader.SubscribeCandles(_candleSeries, DateTime.Today - TimeSpan.FromTicks(((TimeSpan)candleSeries.Arg).Ticks * 100), DateTimeOffset.MaxValue); }