Skip to content

Bar

struct cAlgo.API

DesktopCLICloud

Represents the Bar object.

Definition

public sealed struct Bar : ValueType

Namespace: cAlgo.API · Group: Bars

Examples

var bar = Bars.Last(1);
var direction = bar.Close > bar.Open ? "bullish" : "bearish";
Print("Last closed bar at {0} was {1}: O {2} H {3} L {4} C {5}", bar.OpenTime, direction, bar.Open, bar.High, bar.Low, bar.Close);
bar = api.Bars.Last(1)
direction = "bullish" if bar.Close > bar.Open else "bearish"
api.Print(f"Last closed bar at {bar.OpenTime} was {direction}: O {bar.Open} H {bar.High} L {bar.Low} C {bar.Close}")

Properties

Name Description
CloseDesktopCLIClouddouble Gets the Close price.
HighDesktopCLIClouddouble Gets the High price.
LowDesktopCLIClouddouble Gets the Low price.
OpenDesktopCLIClouddouble Gets the open price.
OpenTimeDesktopCLICloudDateTime Gets the bar open time.
TickVolumeDesktopCLICloudlong Gets the Tick volume.

See also