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

            if (candleSeries == null)
            {
                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);

            Title = candleSeries.ToString();
        }
Esempio n. 2
0
        public ChartWindow(CandleSeries candleSeries, DateTimeOffset?from = null, DateTimeOffset?to = null)
        {
            InitializeComponent();

            _candleSeries = candleSeries ?? throw new ArgumentNullException(nameof(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();
        }