---
id: "M:cAlgo.API.FavoriteTimeFrames.Add(cAlgo.API.TimeFrame)"
kind: "method"
type: "T:cAlgo.API.FavoriteTimeFrames"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/FavoriteTimeFrames/Add/"
---

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

# FavoriteTimeFrames.Add

Member of [FavoriteTimeFrames](https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/FavoriteTimeFrames/index.md).

## Add(TimeFrame timeFrame)

Adds a time frame to favorite TimeFrames.

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.

C#:

```csharp
void Add(TimeFrame timeFrame)
```

Python:

```python
favoriteTimeFrames.Add(timeFrame: TimeFrame) -> None
```

### Parameters

- `timeFrame` (`TimeFrame`, Python `TimeFrame`): TimeFrame

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
TimeFrameManager.Favorite.Add(TimeFrame.Hour4);
Print("Hour4 is favorite: {0}", TimeFrameManager.Favorite.Contains(TimeFrame.Hour4));
```

Python:

```python
api.TimeFrameManager.Favorite.Add(TimeFrame.Hour4)
api.Print(f"Hour4 is favorite: {api.TimeFrameManager.Favorite.Contains(TimeFrame.Hour4)}")
```

