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

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

# BarOutputAttribute (class)

This attribute is used for marking an indicator IndicatorBars property as a bar Output.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public sealed class BarOutputAttribute : Attribute
```

Available since cAlgo.API 5.4.

## Remarks

Marks a IndicatorBars property as output to be displayed on the chart or panel below. To make it effective please apply this attribute in front of the declaration of the IndicatorBars to be displayed.

## Examples

C#:

```csharp
using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo;

public partial class BarsOutputSample : Indicator
{
    private ExponentialMovingAverage _openEma;
    private ExponentialMovingAverage _highEma;
    private ExponentialMovingAverage _lowEma;
    private ExponentialMovingAverage _closeEma;

    protected override void Initialize()
    {
        _openEma = Indicators.ExponentialMovingAverage(Bars.OpenPrices, EmaPeriods);
        _highEma = Indicators.ExponentialMovingAverage(Bars.HighPrices, EmaPeriods);
        _lowEma = Indicators.ExponentialMovingAverage(Bars.LowPrices, EmaPeriods);
        _closeEma = Indicators.ExponentialMovingAverage(Bars.ClosePrices, EmaPeriods);
    }

    public override void Calculate(int index)
    {
        Result[index] = new(
            _openEma.Result[index],
            _highEma.Result[index],
            _lowEma.Result[index],
            _closeEma.Result[index],
            Convert.ToInt64(Bars.TickVolumes[index]));
    }
}
```

Python:

```python
class BarsOutputSample():
    def initialize(self):
        self.openEma = api.Indicators.ExponentialMovingAverage(api.Bars.OpenPrices, api.EmaPeriods)
        self.highEma = api.Indicators.ExponentialMovingAverage(api.Bars.HighPrices, api.EmaPeriods)
        self.lowEma = api.Indicators.ExponentialMovingAverage(api.Bars.LowPrices, api.EmaPeriods)
        self.closeEma = api.Indicators.ExponentialMovingAverage(api.Bars.ClosePrices, api.EmaPeriods)

    def calculate(self, index):
        api.Result[index] = OhlcvBar(self.openEma.Result[index], self.highEma.Result[index], self.lowEma.Result[index], self.closeEma.Result[index], int(api.Bars.TickVolumes[index]))
```

config.json:

```json
{
  "AccessRights": "None",
  "IsOverlay": false,
  "Parameters": [
    {
      "Name": "EmaPeriods",
      "DisplayName": "EMA Periods",
      "Type": "Integer",
      "DefaultValue": 9
    }
  ],
  "BarOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

## Constructors

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

## Properties

- `public string AreaChartFillColor {get; set;}` — Gets or sets the color of the area chart. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/AreaChartFillColor/index.md)
- `public string BearFillColor {get; set;}` — Gets or sets the color of the bear candle fill. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/BearFillColor/index.md)
- `public string BearOutlineColor {get; set;}` — Gets or sets the color of the bear candle or bar outline. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/BearOutlineColor/index.md)
- `public string BullFillColor {get; set;}` — Gets or sets the color of the bull candle fill. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/BullFillColor/index.md)
- `public string BullOutlineColor {get; set;}` — Gets or sets the color of the bull candle or bar outline. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/BullOutlineColor/index.md)
- `public ChartType ChartType {get; set;}` — Gets or sets the type of the chart - Bar, Candlesticks, Line or Dots chart. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/ChartType/index.md)
- `public string Description {get; set;}` — Gets or sets description for output that will be shown in UI. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/Description/index.md)
- `public string DotChartColor {get; set;}` — Gets or sets the color of the dot chart. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/DotChartColor/index.md)
- `public bool IsColorCustomizable {get; set;}` — Gets or sets if Output line color is customizable or not. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/IsColorCustomizable/index.md)
- `public bool IsLastValueVisibleInTitle {get; set;}` — Gets or sets if output last value should be visible or not in instance title (default: true). [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/IsLastValueVisibleInTitle/index.md)
- `public bool IsVisible {get; set;}` — Gets or sets default visibility of output. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/IsVisible/index.md)
- `public string Name {get;}` — The output name [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/Name/index.md)
- `public string TickVolumeColor {get; set;}` — Gets or sets the color of the tick volume bars. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/BarOutputAttribute/TickVolumeColor/index.md)

