Skip to content

IndicatorAttribute

class cAlgo.API

DesktopCLICloud

Indicator Attribute. Applies metadata to enable the indicator plot.

Definition

public sealed class IndicatorAttribute : Attribute

Namespace: cAlgo.API · Group: Attributes

Remarks

To make it effective apply enclosed in square brackets, e.g. [Indicator] before the indicator class declaration. Cannot be omitted.

Examples

using cAlgo.API;

namespace cAlgo.Indicators
{
    public partial class SampleIndicator : Indicator
    {
        public override void Calculate(int index)
        {
            Result[index] = Bars.ClosePrices[index] - Bars.OpenPrices[index];
        }
    }
}
class SampleIndicator():
    def calculate(self, index):
        api.Result[index] = api.Bars.ClosePrices[index] - api.Bars.OpenPrices[index]
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": false,
  "ScalePrecision": 5,
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}

Constructors

Name Description
IndicatorAttributeDesktopCLICloud Initializes a new instance of the IndicatorAttribute

Properties

Name Description
AccessRightsDesktopCLICloudAccessRights Gets or sets the access rights required for Indicator.
AdditionalInfoUrlDesktopCLICloudstring Gets or sets additional info url.
AutoRescaleDesktopCLICloudbool Indicates whether this instance automatically rescales the chart or not. Default value is true.
IsOverlayDesktopCLICloudbool Indicates whether this instance is overlayed on the chart or plotted on a separate indicator panel
IsPercentageDesktopCLICloudbool Gets or sets whether the indicator is a percentage indicator. If one or more percentage indicators are added to the same panel, they will share the same scale. The default value is false.
NameDesktopCLICloudstring The name of the Indicator.
ScalePrecisionDesktopCLICloudint The price scale precision.
TimeZoneDesktopCLICloudstring Gets or sets the chart timezone of the displayed indicator.
Deprecated members (2)
  • public IndicatorAttribute(string name) — Deprecated.
  • public static int UnspecifiedScalePrecision; — Deprecated.