---
id: "T:cAlgo.API.IndicatorAttribute"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# IndicatorAttribute (class)

Indicator Attribute. Applies metadata to enable the indicator plot.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public sealed class IndicatorAttribute : Attribute
```

## Remarks

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

## Examples

C#:

```csharp
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];
        }
    }
}
```

Python:

```python
class SampleIndicator():
    def calculate(self, index):
        api.Result[index] = api.Bars.ClosePrices[index] - api.Bars.OpenPrices[index]
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": false,
  "ScalePrecision": 5,
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

## Constructors

- `public IndicatorAttribute()` — Initializes a new instance of the IndicatorAttribute [details](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/Constructor/index.md)

## Properties

- `public AccessRights AccessRights {get; set;}` — Gets or sets the access rights required for Indicator. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/AccessRights/index.md)
- `public string AdditionalInfoUrl {get; set;}` — Gets or sets additional info url. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/AdditionalInfoUrl/index.md)
- `public bool AutoRescale {get; set;}` — Indicates whether this instance automatically rescales the chart or not. Default value is true. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/AutoRescale/index.md)
- `public bool IsOverlay {get; set;}` — Indicates whether this instance is overlayed on the chart or plotted on a separate indicator panel [details](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/IsOverlay/index.md)
- `public bool IsPercentage {get; set;}` — 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 . [details](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/IsPercentage/index.md)
- `public string Name {get;}` — The name of the Indicator. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/Name/index.md)
- `public int ScalePrecision {get; set;}` — The price scale precision. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/ScalePrecision/index.md)
- `public string TimeZone {get; set;}` — Gets or sets the chart timezone of the displayed indicator. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/TimeZone/index.md)

## Deprecated members

- `public IndicatorAttribute(string name)` — Deprecated.
- `public static int UnspecifiedScalePrecision;` — Deprecated.

