---
id: "T:cAlgo.API.TimeFrameManager"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/TimeFrameManager/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# TimeFrameManager (interface)

Provides access to TimeFrames API for plugins.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

## Definition

```csharp
public interface TimeFrameManager
```

Available since cAlgo.API 5.3.

## Examples

C#:

```csharp
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());
```

Python:

```python
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

- `CustomTimeFrames Custom {get;}` — Provides access to Custom TimeFrames API. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/TimeFrameManager/Custom/index.md)
- `FavoriteTimeFrames Favorite {get;}` — Provides access to Favorite TimeFrames API. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/TimeFrameManager/Favorite/index.md)

