---
id: "T:cAlgo.API.BacktestingBar"
kind: "struct"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/"
---

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

# BacktestingBar (struct)

Represents an OHLCV 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 BacktestingBar : ValueType
```

Available since cAlgo.API 5.3.

## Examples

C#:

```csharp
var lastBar = MarketData.GetBars(TimeFrame.Minute, "EURUSD").LastBar;
var bar = new BacktestingBar(lastBar.OpenTime, lastBar.Open, lastBar.High, lastBar.Low, lastBar.Close, (long)lastBar.TickVolume);
Print("Backtesting bar {0}: O={1} H={2} L={3} C={4} V={5}", bar.Time, bar.Open, bar.High, bar.Low, bar.Close, bar.Volume);
```

Python:

```python
lastBar = api.MarketData.GetBars(TimeFrame.Minute, "EURUSD").LastBar
bar = BacktestingBar(lastBar.OpenTime, lastBar.Open, lastBar.High, lastBar.Low, lastBar.Close, int(lastBar.TickVolume))
api.Print(f"Backtesting bar {bar.Time}: O={bar.Open} H={bar.High} L={bar.Low} C={bar.Close} V={bar.Volume}")
```

## Constructors

- `public BacktestingBar(DateTime Time, double Open, double High, double Low, double Close, long Volume)` — Represents an OHLCV bar. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/Constructor/index.md)

## Properties

- `public double Close {get; set;}` — Close Price [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/Close/index.md)
- `public double High {get; set;}` — High Price [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/High/index.md)
- `public double Low {get; set;}` — Low Price [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/Low/index.md)
- `public double Open {get; set;}` — Open Price [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/Open/index.md)
- `public DateTime Time {get; set;}` — Open Time [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/Time/index.md)
- `public long Volume {get; set;}` — Volume Amount [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/Volume/index.md)

