Skip to content

Plugin.TimeFrameManager

property · Plugin · cAlgo.API Since 5.3

DesktopCLICloud

Provides access to TimeFrames API.

Environment behaviour

CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.

Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.

Definition

public TimeFrameManager TimeFrameManager {get;}
api.TimeFrameManager: TimeFrameManager

Returns TimeFrameManager

Examples

TimeFrameManager.Favorite.Add(TimeFrame.Hour4);
var customTimeFrame = TimeFrameManager.Custom.Get("My Custom TF") ?? TimeFrameManager.Custom.Add("My Custom TF");
Print("Custom time frame: {0}", customTimeFrame.Name);
api.TimeFrameManager.Favorite.Add(TimeFrame.Hour4)
customTimeFrame = api.TimeFrameManager.Custom.Get("My Custom TF")
if customTimeFrame is None:
    customTimeFrame = api.TimeFrameManager.Custom.Add("My Custom TF")
api.Print(f"Custom time frame: {customTimeFrame.Name}")