---
id: "M:cAlgo.API.IndicatorAttribute.#ctor"
kind: "constructor"
type: "T:cAlgo.API.IndicatorAttribute"
url: "https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/Constructor/"
---

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

# IndicatorAttribute constructor

Member of [IndicatorAttribute](https://help.ctrader.com/ctrader-algo/references/Attributes/IndicatorAttribute/index.md).

## IndicatorAttribute()

Initializes a new instance of the IndicatorAttribute

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public IndicatorAttribute()
```

Python:

```python
IndicatorAttribute()
```

### Examples

C#:

```csharp
public partial class SampleIndicator : Indicator
{
    public override void Calculate(int index)
    {
        Result[index] = Bars.ClosePrices[index];
    }
}
```

Python:

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

config.json:

```json
{
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

