Skip to content

CustomTimeFrames.Get

method · CustomTimeFrames · cAlgo.API Since 5.3

DesktopCLICloud

Returns a custom time frame by it's name.

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

CustomTimeFrame Get(string name)
customTimeFrames.Get(name: str) -> CustomTimeFrame | None

Parameters

Name C# type Python type Description
name string str Name of custom time frame

Returns CustomTimeFrame — CustomTimeFrame if custom time frame found otherwise null.

Examples

var customTimeFrame = TimeFrameManager.Custom.Get("My Custom TF");
if (customTimeFrame == null)
    Print("Custom time frame not found");
else
    Print("Found custom time frame: {0}", customTimeFrame.Description);
customTimeFrame = api.TimeFrameManager.Custom.Get("My Custom TF")
if customTimeFrame is None:
    api.Print("Custom time frame not found")
else:
    api.Print(f"Found custom time frame: {customTimeFrame.Description}")