BacktestingBarsData constructor
constructor · BacktestingBarsData · cAlgo.API Since 5.3
DesktopCLICloud
Creates a new instance of BacktestingBarsData with passed data.
Environment behaviour
CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.
Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.
Definition
public BacktestingBarsData(IEnumerable<BacktestingBar> data)
BacktestingBarsData(data: Iterable[BacktestingBar])
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
data | IEnumerable<BacktestingBar> | Iterable[BacktestingBar] | Bars data |
Examples
var bars = new List<BacktestingBar>
{
new BacktestingBar(new DateTime(2025, 1, 2, 0, 0, 0, DateTimeKind.Utc), 1.0350, 1.0365, 1.0342, 1.0360, 1200),
new BacktestingBar(new DateTime(2025, 1, 2, 0, 1, 0, DateTimeKind.Utc), 1.0360, 1.0371, 1.0355, 1.0368, 950)
};
var barsData = new BacktestingBarsData(bars);
from System import Array, DateTime, DateTimeKind
bars = [
BacktestingBar(DateTime(2025, 1, 2, 0, 0, 0, DateTimeKind.Utc), 1.0350, 1.0365, 1.0342, 1.0360, 1200),
BacktestingBar(DateTime(2025, 1, 2, 0, 1, 0, DateTimeKind.Utc), 1.0360, 1.0371, 1.0355, 1.0368, 950)
]
barsData = BacktestingBarsData(Array[BacktestingBar](bars))