CustomBarsNeedsMoreEventArgs.CustomBars
property · CustomBarsNeedsMoreEventArgs · cAlgo.API Since 5.3
DesktopCLICloud
Gets custom bars that needs more 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
public CustomBars CustomBars {get;}
customBarsNeedsMoreEventArgs.CustomBars: CustomBars
Returns CustomBars
Examples
protected override void OnStart()
{
var customTimeFrame = TimeFrameManager.Custom.Add("My Time Frame");
var customBars = customTimeFrame.AddBars(Symbols.GetSymbol("EURUSD"));
customBars.NeedsMore += OnCustomBarsNeedsMore;
}
private void OnCustomBarsNeedsMore(CustomBarsNeedsMoreEventArgs args)
{
var customBars = args.CustomBars;
Print("Loaded: {0}, bars count: {1}", customBars.IsLoaded, customBars.Bars.Count);
}
def on_start(self):
customTimeFrame = api.TimeFrameManager.Custom.Add("My Time Frame")
customBars = customTimeFrame.AddBars(api.Symbols.GetSymbol("EURUSD"))
customBars.NeedsMore += self.on_custom_bars_needs_more
def on_custom_bars_needs_more(self, args):
customBars = args.CustomBars
api.Print(f"Loaded: {customBars.IsLoaded}, bars count: {customBars.Bars.Count}")