Skip to content

IndicatorAttribute

Summary

Indicator Attribute. Applies metadata to enable the indicator plot.

Remarks

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

Signature

1
public sealed class IndicatorAttribute : Attribute

Namespace

cAlgo.API

Examples

1
2
3
4
5
6
7
8
 namespace cAlgo.Indicators
{
    [Indicator]
    public class SampleIndicator : Indicator
    {
        //...
    }
}
1
2
 [Indicator(ScalePrecision = 5, IsOverlay = false, TimeZone = TimeZones.UTC)]
 public class SampleIndicator : Indicator

Properties

Name

Summary

The name of the Indicator.

Remarks

The name is displayed to the left of the indicator panel.

Signature

1
public string Name {get;}

Return Value

string

Examples

1
2
3
4
5
6
7
8
 namespace cAlgo.Indicators
 {
     [Indicator("IndicatorName")]
     public class SampleIndicator : Indicator
     {
         //...
     }
 }

ScalePrecision

Summary

The price scale precision.

Remarks

The number of decimals displayed on the price scale of the indicator panel

Signature

1
public int ScalePrecision {get; set;}

Return Value

int

Examples

1
2
3
4
5
6
7
8
 namespace cAlgo.Indicators
 {
     [Indicator(ScalePrecision = 5)] // The scale precision is 5 decimals.
     public class SampleIndicator : Indicator
     {
         //...
     }
 }

IsOverlay

Summary

Indicates whether this instance is overlayed on the chart or plotted on a separate indicator panel

Signature

1
public bool IsOverlay {get; set;}

Return Value

bool

Examples

1
2
 [Indicator(IsOverlay = true)] // Plots the Indicator on the chart
 public class SampleIndicator : Indicator
1
2
 [Indicator(IsOverlay = false)] // Plots the Indicator on a separate indicator panel.
 public class SampleIndicator : Indicator

AutoRescale

Summary

Indicates whether this instance automatically rescales the chart or not. Default value is true.

Signature

1
public bool AutoRescale {get; set;}

Return Value

bool

Examples

1
2
 [Indicator(AutoRescale = false)]
 public class SampleIndicator : Indicator

TimeZone

Summary

Gets or sets the chart timezone of the displayed indicator.

Signature

1
public string TimeZone {get; set;}

Return Value

string

Examples

1
2
 [Indicator(TimeZone = TimeZones.UTC)]
 public class SampleIndicator : Indicator

AccessRights

Summary

Gets or sets the access rights required for Indicator.

Signature

1
public AccessRights AccessRights {get; set;}

Return Value

AccessRights

Related Tutorials

IsPercentage

Summary

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.

Signature

1
public bool IsPercentage {get; set;}

Return Value

bool

Examples

1
2
 [Indicator(IsPercentage = true)]
 public class SamplePercentageIndicator : Indicator

Fields

UnspecifiedScalePrecision

Signature

1
public static int UnspecifiedScalePrecision;

Return Value

int