Skip to content

BarOutputAttribute

Summary

This attribute is used for marking an indicator IndicatorBars property as a bar Output.

Remarks

Marks a IndicatorBars property as output to be displayed on the chart or panel below.To make it effective please apply this attribute in front of the declaration of the IndicatorBars to bedisplayed.

Signature

1
public sealed class BarOutputAttribute : Attribute

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 using System;
 using cAlgo.API;
 using cAlgo.API.Indicators;
 namespace cAlgo;
 [Indicator(AccessRights = AccessRights.None, IsOverlay = false)]
 public class BarsOutputSample : Indicator
 {
     private ExponentialMovingAverage _openEma;
     private ExponentialMovingAverage _highEma;
     private ExponentialMovingAverage _lowEma;
     private ExponentialMovingAverage _closeEma;
     [Parameter("EMA Periods", DefaultValue = 9)]
     public int EmaPeriods { get; set; }
     [BarOutput("Main")]
     public IndicatorBars Result { get; set; }
     protected override void Initialize()
     {
         _openEma = Indicators.ExponentialMovingAverage(Bars.OpenPrices, EmaPeriods);
         _highEma = Indicators.ExponentialMovingAverage(Bars.HighPrices, EmaPeriods);
         _lowEma = Indicators.ExponentialMovingAverage(Bars.LowPrices, EmaPeriods);
         _closeEma = Indicators.ExponentialMovingAverage(Bars.ClosePrices, EmaPeriods);
     }
     public override void Calculate(int index)
     {
         Result[index] = new(
             _openEma.Result[index],
             _highEma.Result[index],
             _lowEma.Result[index],
             _closeEma.Result[index],
             Convert.ToInt64(Bars.TickVolumes[index]));
     }
 }

See Also

Properties

Name

Summary

The output name

Signature

1
public string Name {get;}

Return Value

string

ChartType

Summary

Gets or sets the type of the chart - Bar, Candlesticks, Line or Dots chart.

Signature

1
public ChartType ChartType {get; set;}

Return Value

ChartType

BullOutlineColor

Summary

Gets or sets the color of the bull candle or bar outline.

Signature

1
public string BullOutlineColor {get; set;}

Return Value

string

BearOutlineColor

Summary

Gets or sets the color of the bear candle or bar outline.

Signature

1
public string BearOutlineColor {get; set;}

Return Value

string

BullFillColor

Summary

Gets or sets the color of the bull candle fill.

Signature

1
public string BullFillColor {get; set;}

Return Value

string

BearFillColor

Summary

Gets or sets the color of the bear candle fill.

Signature

1
public string BearFillColor {get; set;}

Return Value

string

TickVolumeColor

Summary

Gets or sets the color of the tick volume bars.

Signature

1
public string TickVolumeColor {get; set;}

Return Value

string

AreaChartFillColor

Summary

Gets or sets the color of the area chart.

Signature

1
public string AreaChartFillColor {get; set;}

Return Value

string

DotChartColor

Summary

Gets or sets the color of the dot chart.

Signature

1
public string DotChartColor {get; set;}

Return Value

string

IsColorCustomizable

Summary

Gets or sets if Output line color is customizable or not.

Remarks

This property is useful when you are setting color manually with code via SetBarAppearance method.

Signature

1
public bool IsColorCustomizable {get; set;}

Return Value

bool

IsLastValueVisibleInTitle

Summary

Gets or sets if output last value should be visible or not in instance title (default: true).

Signature

1
public bool IsLastValueVisibleInTitle {get; set;}

Return Value

bool

Description

Summary

Gets or sets description for output that will be shown in UI.

Signature

1
public string Description {get; set;}

Return Value

string