Skip to content

CustomTimeFrameNewChartEventArgs.CustomTimeFrame

property · CustomTimeFrameNewChartEventArgs · 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;}
customTimeFrameNewChartEventArgs.CustomTimeFrame: CustomTimeFrame

Returns CustomTimeFrame

Examples

protected override void OnStart()
{
    var customTimeFrame = TimeFrameManager.Custom.Add("My Time Frame");
    customTimeFrame.NewChart += OnCustomTimeFrameNewChart;
}

private void OnCustomTimeFrameNewChart(CustomTimeFrameNewChartEventArgs args)
{
    Print("Custom time frame: {0} | Description: {1}", args.CustomTimeFrame.Name, args.CustomTimeFrame.Description);
}
def on_start(self):
    customTimeFrame = api.TimeFrameManager.Custom.Add("My Time Frame")
    customTimeFrame.NewChart += self.on_custom_time_frame_new_chart

def on_custom_time_frame_new_chart(self, args):
    api.Print(f"Custom time frame: {args.CustomTimeFrame.Name} | Description: {args.CustomTimeFrame.Description}")