CandleDataSeries - candles

Modified on Fri, 04 Aug 2023 at 01:26 PM

The DataSeries designed for visualization of candles. Each element represents a Candle.

Example of the indicator which displays an inverted chart:

public class ReversalChart:Indicator
 {
     readonly CandleDataSeries _reversalCandles=new CandleDataSeries("Candles");
     public ReversalChart()
     {
         ((ValueDataSeries)DataSeries[0]).VisualType=VisualMode.Hide;//Скрываем датасерию по умолчанию
         DataSeries.Add(_reversalCandles);//Добавляем датасерию свечек
         Panel = IndicatorDataProvider.NewPanel;//По умолчанию свечки будем отображать в отдельном окне
     }
     protected override void OnCalculate(int bar, decimal value)
     {
         var candle = GetCandle(bar);
         _reversalCandles[bar].High = -candle.High;
         _reversalCandles[bar].Low = -candle.Low;
         _reversalCandles[bar].Open = -candle.Open;
         _reversalCandles[bar].Close = -candle.Close;
     }
 }

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article