---
id: "T:cAlgo.API.CustomBar"
kind: "struct"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomBar/"
---

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

# CustomBar (struct)

Represents a custom OHLC bar.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

## Definition

```csharp
public sealed struct CustomBar : ValueType
```

Available since cAlgo.API 5.3.

## Examples

C#:

```csharp
var customBars = TimeFrameManager.Custom.Add("My Custom TF").AddBars(Symbols.GetSymbol("EURUSD"));
var bar = new CustomBar(Server.Time, 1.1000, 1.1050, 1.0980, 1.1020, 1500);
customBars.AppendBar(bar);
Print("Appended bar {0} O={1} H={2} L={3} C={4}", bar.Time, bar.Open, bar.High, bar.Low, bar.Close);
```

Python:

```python
customBars = api.TimeFrameManager.Custom.Add("My Custom TF").AddBars(api.Symbols.GetSymbol("EURUSD"))
bar = CustomBar(api.Server.Time, 1.1000, 1.1050, 1.0980, 1.1020, 1500)
customBars.AppendBar(bar)
api.Print(f"Appended bar {bar.Time} O={bar.Open} H={bar.High} L={bar.Low} C={bar.Close}")
```

## Constructors

- `public CustomBar(DateTime time, double open, double high, double low, double close, long volume)` — Creates a new custom bar. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomBar/Constructor/index.md)

## Properties

- `public double Close {get;}` — Gets close price of bar. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomBar/Close/index.md)
- `public double High {get;}` — Gets high price of bar. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomBar/High/index.md)
- `public double Low {get;}` — Gets low price of bar. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomBar/Low/index.md)
- `public double Open {get;}` — Gets open price of bar. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomBar/Open/index.md)
- `public DateTime Time {get;}` — Gets open time of bar. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomBar/Time/index.md)
- `public long Volume {get;}` — Gets volume of bar. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomBar/Volume/index.md)

