Skip to content

CustomTimeFrameBarsNeededArgs.CustomTimeFrame

property · CustomTimeFrameBarsNeededArgs · 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;}
customTimeFrameBarsNeededArgs.CustomTimeFrame: CustomTimeFrame

Returns CustomTimeFrame

Examples

protected override void OnStart()
{
    TimeFrameManager.Custom.Add("My Custom TF").BarsNeeded = OnBarsNeeded;
}

private void OnBarsNeeded(CustomTimeFrameBarsNeededArgs args)
{
    Print("Custom time frame {0} needs bars", args.CustomTimeFrame.Name);
}
from System import Action

def on_start(self):
    api.TimeFrameManager.Custom.Add("My Custom TF").BarsNeeded = Action[CustomTimeFrameBarsNeededArgs](self.on_bars_needed)

def on_bars_needed(self, args):
    api.Print(f"Custom time frame {args.CustomTimeFrame.Name} needs bars")