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

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

# BarOutputAttribute constructor

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

## BarOutputAttribute(string name)

Initializes a new instance of the BarOutputAttribute and sets the name.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public BarOutputAttribute(string name)
```

Python:

```python
BarOutputAttribute(name: str)
```

### Parameters

- `name` (`string`, Python `str`):

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
public partial class BarOutputSample : Indicator
{
    public override void Calculate(int index)
    {
        Result[index] = new OhlcvBar(Bars.OpenPrices[index], Bars.HighPrices[index], Bars.LowPrices[index], Bars.ClosePrices[index], (long)Bars.TickVolumes[index]);
    }
}
```

Python:

```python
def calculate(self, index):
    api.Result[index] = OhlcvBar(api.Bars.OpenPrices[index], api.Bars.HighPrices[index], api.Bars.LowPrices[index], api.Bars.ClosePrices[index], int(api.Bars.TickVolumes[index]))
```

config.json:

```json
{
  "AccessRights": "None",
  "IsOverlay": false,
  "BarOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

