public ChartWindow(CandleSeries candleSeries, DateTime from, DateTime to) { 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, from, to); }
public ChartWindow(CandleSeries candleSeries, DateTime from, DateTime to) { InitializeComponent(); if (candleSeries.IsNull()) { throw new ArgumentNullException(nameof(candleSeries)); } _candleSeries = candleSeries; _trader = MainWindow.Instance.Trader; Chart.ChartTheme = ChartThemes.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.NewMessage += ProcessNewMessage; _trader.SubscribeMarketData(candleSeries.Security, new MarketDataMessage { TransactionId = _transactionId = _trader.TransactionIdGenerator.GetNextId(), DataType = MarketDataTypes.CandleTimeFrame, //SecurityId = GetSecurityId(series.Security), Arg = candleSeries.Arg, IsSubscribe = true, From = from, To = to, }); }