Skip to content

OutputAttribute

class cAlgo.API

DesktopCLICloud

This attribute is used for marking an indicator IndicatorDataSeries property as a line Output.

Definition

public sealed class OutputAttribute : Attribute

Namespace: cAlgo.API · Group: Attributes

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.

Examples

using cAlgo.API;

namespace cAlgo
{
    // This sample declares the indicator outputs with the LineOutputs entry of config.json
    public partial class OutputAttributeSample : Indicator
    {
        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];
        }
    }
}
class OutputAttributeSample():
    def calculate(self, index):
        api.OpenOutput[index] = api.Bars.OpenPrices[index]
        api.HighOutput[index] = api.Bars.HighPrices[index]
        api.LowOutput[index] = api.Bars.LowPrices[index]
        api.CloseOutput[index] = api.Bars.ClosePrices[index]
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": false,
  "LineOutputs": [
    {
      "Name": "OpenOutput",
      "DisplayName": "Open",
      "Color": "Red",
      "Style": "Dots",
      "PlotType": "Line",
      "Thickness": 2
    },
    {
      "Name": "HighOutput",
      "DisplayName": "High",
      "Color": "Blue",
      "Style": "Solid",
      "PlotType": "Line",
      "Thickness": 2
    },
    {
      "Name": "LowOutput",
      "DisplayName": "Low",
      "Color": "Yellow",
      "Style": "Lines",
      "PlotType": "Line",
      "Thickness": 2
    },
    {
      "Name": "CloseOutput",
      "DisplayName": "Close",
      "Color": "Green",
      "Style": "DotsRare",
      "PlotType": "Line",
      "Thickness": 2
    }
  ]
}

Constructors

Name Description
OutputAttributeDesktopCLICloud Initializes a new instance of the OutputAttribute and sets the name.

Properties

Name Description
DescriptionDesktopCLICloudstring Gets or sets description for output that will be shown in UI.
IsColorCustomizableDesktopCLICloudbool Gets or sets if Output line color is customizable or not.
IsLastValueVisibleInTitleDesktopCLICloudbool Gets or sets if output last value should be visible or not in instance title (default: true).
IsVisibleDesktopCLICloudbool Gets or sets default visibility of output.
LineColorDesktopCLICloudstring Gets or sets the Color of the Output property. This Color will be used when the line for this Output is plotted.
LineStyleDesktopCLICloudLineStyle Gets or sets the Line Style for given Output property. By default it is set to Solid
NameDesktopCLICloudstring The plot name
PlotTypeDesktopCLICloudPlotType Plot type.
ThicknessDesktopCLICloudfloat Sets the Width of the Output property.
Deprecated members (2)
  • public Colors Color {get; set;} — Use LineColor instead.
  • public bool IsHistogram {get; set;} — Use PlotType instead.