CustomBar
struct cAlgo.API Since 5.3
DesktopCLICloud
Represents a custom OHLC 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 CustomBar : ValueType
Namespace: cAlgo.API · Group: Custom
Examples
var customBars = TimeFrameManager.Custom.Add("My Custom TF").AddBars(Symbols.GetSymbol("EURUSD"));
var bar = new CustomBar(Server.Time, 1.1000, 1.1050, 1.0980, 1.1020, 1500);
customBars.AppendBar(bar);
Print("Appended bar {0} O={1} H={2} L={3} C={4}", bar.Time, bar.Open, bar.High, bar.Low, bar.Close);
customBars = api.TimeFrameManager.Custom.Add("My Custom TF").AddBars(api.Symbols.GetSymbol("EURUSD"))
bar = CustomBar(api.Server.Time, 1.1000, 1.1050, 1.0980, 1.1020, 1500)
customBars.AppendBar(bar)
api.Print(f"Appended bar {bar.Time} O={bar.Open} H={bar.High} L={bar.Low} C={bar.Close}")
Constructors
| Name | Description |
|---|---|
| CustomBarDesktopCLICloud | Creates a new custom bar. |
Properties
| Name | Description |
|---|---|
CloseDesktopCLIClouddouble | Gets close price of bar. |
HighDesktopCLIClouddouble | Gets high price of bar. |
LowDesktopCLIClouddouble | Gets low price of bar. |
OpenDesktopCLIClouddouble | Gets open price of bar. |
TimeDesktopCLICloudDateTime | Gets open time of bar. |
VolumeDesktopCLICloudlong | Gets volume of bar. |