Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (61 sloc) 2.11 KB
#region S# License
NOTICE!!! This program and source code is owned and licensed by
StockSharp, LLC,
Viewing or use of this code requires your acceptance of the license
agreement found at
Removal of this comment is a violation of the license agreement.
Project: SampleQuik.SampleQuikPublic
File: ChartWindow.xaml.cs
Created: 2015, 11, 11, 2:32 PM
Copyright 2010 by StockSharp, LLC
#endregion S# License
namespace SampleQuik
using System;
using System.ComponentModel;
using System.Windows.Media;
using StockSharp.Algo.Candles;
using StockSharp.Quik;
using StockSharp.Xaml.Charting;
partial class ChartWindow
private readonly QuikTrader _trader;
private readonly CandleSeries _candleSeries;
private readonly ChartCandleElement _candleElem;
public ChartWindow(CandleSeries candleSeries, DateTimeOffset? from = null, DateTimeOffset? to = null)
_candleSeries = candleSeries ?? throw new ArgumentNullException(nameof(candleSeries));
_trader = MainWindow.Instance.Trader;
Chart.ChartTheme = ChartThemes.ExpressionDark;
var area = new ChartArea();
_candleElem = new ChartCandleElement
AntiAliasing = false,
UpFillColor = Colors.White,
UpBorderColor = Colors.Black,
DownFillColor = Colors.Black,
DownBorderColor = Colors.Black,
_trader.CandleSeriesProcessing += ProcessNewCandle;
_trader.SubscribeCandles(_candleSeries, from, to);
Title = candleSeries.ToString();
private void ProcessNewCandle(CandleSeries series, Candle candle)
if (series != _candleSeries)
Chart.Draw(_candleElem, candle);
protected override void OnClosing(CancelEventArgs e)
_trader.CandleSeriesProcessing -= ProcessNewCandle;
You can’t perform that action at this time.