Click or drag to resize


For a candles graphic display, you can use the special Chart component, which draws candles as follows: (see Chart components):

sample candleschart

The candles passed into the ChartHelperDraw method for displaying.

The current candle changes will be displayed when the candle is passed from the ConnectorCandleSeriesProcessing event to draw on the graph.

If you want to display the finished candles, check the State property of candle that came:

// _chart - StockSharp.Xaml.Chart
// a new chart area
private ChartArea _areaComb;
private ChartCandleElement _candleElement;
var series = new CandleSeries(typeof(TimeFrameCandle),_security,TimeSpan.FromMinutes(_timeframe));

_candleElement = new ChartCandleElement() { FullTitle = "Candles" };
Chart.AddElement(_areaComb, _candleElement, series);


_connector.SubscribeCandles(series, DateTime.Today.Subtract(TimeSpan.FromDays(5)), DateTime.Now);            
_connector.CandleSeriesProcessing += Connector_CandleSeriesProcessing;


private void Connector_CandleSeriesProcessing(CandleSeries candleSeries, Candle candle)
    if (candle.State == CandleStates.Finished) 
       var chartData = new ChartDrawData();
       chartData.Group(candle.OpenTime).Add(_candleElement, candle);
See Also

Other Resources