BacktestingBar
struct cAlgo.API Since 5.3
DesktopCLICloud
Represents an OHLCV bar.
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 sealed struct BacktestingBar : ValueType
Namespace: cAlgo.API · Group: DataSource
Examples
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);
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
| Name | Description |
|---|---|
| BacktestingBarDesktopCLICloud | Represents an OHLCV bar. |
Properties
| Name | Description |
|---|---|
CloseDesktopCLIClouddouble | Close Price |
HighDesktopCLIClouddouble | High Price |
LowDesktopCLIClouddouble | Low Price |
OpenDesktopCLIClouddouble | Open Price |
TimeDesktopCLICloudDateTime | Open Time |
VolumeDesktopCLICloudlong | Volume Amount |