---
id: "T:cAlgo.API.IndicatorBars"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/IndicatorBars/"
---

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

# IndicatorBars (interface)

The interface representing an indicator bars that are displayed as an output.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public interface IndicatorBars
```

Available since cAlgo.API 5.4.

## Examples

C#:

```csharp
public partial class HeikinAshiBars : Indicator
{
    public override void Calculate(int index)
    {
        var bar = Bars[index];
        var close = (bar.Open + bar.High + bar.Low + bar.Close) / 4;
        var open = index == 0 ? bar.Open : (Result.OpenPrices[index - 1] + Result.ClosePrices[index - 1]) / 2;
        var high = Math.Max(bar.High, Math.Max(open, close));
        var low = Math.Min(bar.Low, Math.Min(open, close));
        Result[index] = new OhlcvBar(open, high, low, close, bar.TickVolume);
    }
}
```

Python:

```python
def calculate(self, index):
    bar = api.Bars[index]
    closePrice = (bar.Open + bar.High + bar.Low + bar.Close) / 4
    openPrice = bar.Open if index == 0 else (api.Result.OpenPrices[index - 1] + api.Result.ClosePrices[index - 1]) / 2
    highPrice = max(bar.High, openPrice, closePrice)
    lowPrice = min(bar.Low, openPrice, closePrice)
    api.Result[index] = OhlcvBar(openPrice, highPrice, lowPrice, closePrice, bar.TickVolume)
```

config.json:

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

## Properties

- `DataSeries ClosePrices {get;}` — Gets the Close price bars data. [details](https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/IndicatorBars/ClosePrices/index.md)
- `int Count {get;}` — Gets the number of bars. [details](https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/IndicatorBars/Count/index.md)
- `DataSeries HighPrices {get;}` — Gets the High price bars data. [details](https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/IndicatorBars/HighPrices/index.md)
- `OhlcvBar Item {get; set;}` — Gets or sets a bar based on it is index. [details](https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/IndicatorBars/Item/index.md)
- `DataSeries LowPrices {get;}` — Gets the Low price bars data. [details](https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/IndicatorBars/LowPrices/index.md)
- `DataSeries OpenPrices {get;}` — Gets the Open price bars data. [details](https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/IndicatorBars/OpenPrices/index.md)
- `IndicatorBarOutput Output {get;}` — Gets the indicator output. [details](https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/IndicatorBars/Output/index.md)
- `DataSeries TickVolumes {get;}` — Gets the Tick volumes data. [details](https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/IndicatorBars/TickVolumes/index.md)

