Exemplo n.º 1
0
        public ChartWindow(CandleSeries candleSeries, DateTime from, DateTime to)
        {
            InitializeComponent();

            if (candleSeries == null)
            {
                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.CandleSeriesProcessing += ProcessNewCandle;
            _trader.SubscribeCandles(_candleSeries, @from, to);

            Title = candleSeries.ToString();
        }