Skip to content

OutputAttribute

Summary

Sealed Class OutputAttribute

Remarks

Marks a IndicatorDataSeries 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 IndicatorDataSeries to be displayed.

Signature

1
public sealed class OutputAttribute : Attribute

Namespace

cAlgo.API

Properties

Name Description
LineStyle { get; set; } Gets or sets the Line Style for given Output property. By default it is set to Solid
Name { get; } The plot name
Color { get; set; }
LineColor { get; set; } Gets or sets the Color of the Output property. This Color will be used when the line for this Output is plotted.
Thickness { get; set; } Sets the Width of the Output property.
IsHistogram { get; set; } Plots a Histogram.
PlotType { get; set; } Plot type.

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
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use indicators OuputAttribute
     [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class OutputAttributeSample : Indicator
     {
         [Output("Open", LineColor = "Red", IsHistogram = false, LineStyle = LineStyle.Dots, PlotType = PlotType.Line, Thickness = 2)]
         public IndicatorDataSeries OpenOutput { get; set; }
         [Output("High", LineColor = "Blue", IsHistogram = false, LineStyle = LineStyle.Solid, PlotType = PlotType.Line, Thickness = 2)]
         public IndicatorDataSeries HighOutput { get; set; }
         [Output("Low", LineColor = "Yellow", IsHistogram = false, LineStyle = LineStyle.Lines, PlotType = PlotType.Line, Thickness = 2)]
         public IndicatorDataSeries LowOutput { get; set; }
         [Output("Close", LineColor = "Green", IsHistogram = false, LineStyle = LineStyle.DotsRare, PlotType = PlotType.Line, Thickness = 2)]
         public IndicatorDataSeries CloseOutput { get; set; }
         protected override void Initialize()
         {
         }
         public override void Calculate(int index)
         {
             OpenOutput[index] = Bars.OpenPrices[index];
             HighOutput[index] = Bars.HighPrices[index];
             LowOutput[index] = Bars.LowPrices[index];
             CloseOutput[index] = Bars.ClosePrices[index];
         }
     }
 }

Last update: July 1, 2022

Comments