CustomTimeFrameBarsUnloadedEventArgs.CustomTimeFrame
property · CustomTimeFrameBarsUnloadedEventArgs · cAlgo.API Since 5.3
DesktopCLICloud
Gets custom time frame.
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 CustomTimeFrame CustomTimeFrame {get;}
customTimeFrameBarsUnloadedEventArgs.CustomTimeFrame: CustomTimeFrame
Returns CustomTimeFrame
Examples
protected override void OnStart()
{
var customTimeFrame = TimeFrameManager.Custom.Add("My Time Frame");
customTimeFrame.BarsUnloaded += OnCustomTimeFrameBarsUnloaded;
}
private void OnCustomTimeFrameBarsUnloaded(CustomTimeFrameBarsUnloadedEventArgs args)
{
Print("Bars unloaded for custom time frame {0} ({1})", args.CustomTimeFrame.Name, args.CustomTimeFrame.TimeFrame);
}
def on_start(self):
customTimeFrame = api.TimeFrameManager.Custom.Add("My Time Frame")
customTimeFrame.BarsUnloaded += self.on_custom_time_frame_bars_unloaded
def on_custom_time_frame_bars_unloaded(self, args):
api.Print(f"Bars unloaded for custom time frame {args.CustomTimeFrame.Name} ({args.CustomTimeFrame.TimeFrame})")