---
id: "T:cAlgo.API.Bar"
kind: "struct"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/MarketData/Bars/Bar/"
---

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

# Bar (struct)

Represents the Bar object.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public sealed struct Bar : ValueType
```

## Examples

C#:

```csharp
var bar = Bars.Last(1);
var direction = bar.Close > bar.Open ? "bullish" : "bearish";
Print("Last closed bar at {0} was {1}: O {2} H {3} L {4} C {5}", bar.OpenTime, direction, bar.Open, bar.High, bar.Low, bar.Close);
```

Python:

```python
bar = api.Bars.Last(1)
direction = "bullish" if bar.Close > bar.Open else "bearish"
api.Print(f"Last closed bar at {bar.OpenTime} was {direction}: O {bar.Open} H {bar.High} L {bar.Low} C {bar.Close}")
```

## Properties

- `public double Close {get;}` — Gets the Close price. [details](https://help.ctrader.com/ctrader-algo/references/MarketData/Bars/Bar/Close/index.md)
- `public double High {get;}` — Gets the High price. [details](https://help.ctrader.com/ctrader-algo/references/MarketData/Bars/Bar/High/index.md)
- `public double Low {get;}` — Gets the Low price. [details](https://help.ctrader.com/ctrader-algo/references/MarketData/Bars/Bar/Low/index.md)
- `public double Open {get;}` — Gets the open price. [details](https://help.ctrader.com/ctrader-algo/references/MarketData/Bars/Bar/Open/index.md)
- `public DateTime OpenTime {get;}` — Gets the bar open time. [details](https://help.ctrader.com/ctrader-algo/references/MarketData/Bars/Bar/OpenTime/index.md)
- `public long TickVolume {get;}` — Gets the Tick volume. [details](https://help.ctrader.com/ctrader-algo/references/MarketData/Bars/Bar/TickVolume/index.md)

