---
id: "M:cAlgo.API.BacktestingBar.#ctor(System.DateTime,System.Double,System.Double,System.Double,System.Double,System.Int64)"
kind: "constructor"
type: "T:cAlgo.API.BacktestingBar"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/Constructor/"
---

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

# BacktestingBar constructor

Member of [BacktestingBar](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/DataSource/BacktestingBar/index.md).

## BacktestingBar(DateTime Time, double Open, double High, double Low, double Close, long Volume)

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.

C#:

```csharp
public BacktestingBar(DateTime Time, double Open, double High, double Low, double Close, long Volume)
```

Python:

```python
BacktestingBar(Time: DateTime, Open: float, High: float, Low: float, Close: float, Volume: int)
```

### Parameters

- `Time` (`DateTime`, Python `DateTime`): Open Time
- `Open` (`double`, Python `float`): Open Price
- `High` (`double`, Python `float`): High Price
- `Low` (`double`, Python `float`): Low Price
- `Close` (`double`, Python `float`): Close Price
- `Volume` (`long`, Python `int`): Volume Amount

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}")
```

