Skip to content

TimeFrameManager

interface cAlgo.API Since 5.3

DesktopCLICloud

Provides access to TimeFrames API for plugins.

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 interface TimeFrameManager

Namespace: cAlgo.API · Group: TimeFrame

Examples

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

Properties

Name Description
CustomDesktopCLICloudCustomTimeFrames Provides access to Custom TimeFrames API.
FavoriteDesktopCLICloudFavoriteTimeFrames Provides access to Favorite TimeFrames API.