CustomTimeFrames.Add
method · CustomTimeFrames · cAlgo.API Since 5.3
DesktopCLICloud
Adds a new 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
CustomTimeFrame Add(string name)
customTimeFrames.Add(name: str) -> CustomTimeFrame
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
name | string | str | Custom time frame unique name. |
Returns CustomTimeFrame — CustomTimeFrame
Examples
var customTimeFrame = TimeFrameManager.Custom.Add("My Custom TF");
customTimeFrame.Description = "Bars provided by my plugin";
Print("Added custom time frame {0}", customTimeFrame.Name);
customTimeFrame = api.TimeFrameManager.Custom.Add("My Custom TF")
customTimeFrame.Description = "Bars provided by my plugin"
api.Print(f"Added custom time frame {customTimeFrame.Name}")