Skip to content

CustomBars.Bars

property · CustomBars · cAlgo.API Since 5.3

DesktopCLICloud

Gets readonly bars.

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

Bars Bars {get;}
customBars.Bars: Bars

Returns Bars

Examples

var customBars = TimeFrameManager.Custom.Add("My Custom TF").AddBars(Symbols.GetSymbol("EURUSD"));
var sma = Indicators.SimpleMovingAverage(customBars.Bars.ClosePrices, 14);
Print("Custom bars: {0}, SMA: {1}", customBars.Bars.Count, sma.Result.LastValue);
customBars = api.TimeFrameManager.Custom.Add("My Custom TF").AddBars(api.Symbols.GetSymbol("EURUSD"))
sma = api.Indicators.SimpleMovingAverage(customBars.Bars.ClosePrices, 14)
api.Print(f"Custom bars: {customBars.Bars.Count}, SMA: {sma.Result.LastValue}")