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

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

# FavoriteTimeFrames.Contains

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

## Contains(TimeFrame timeFrame)

Returns True if passed TimeFrame is in favorite TimeFrames otherwise False.

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
bool Contains(TimeFrame timeFrame)
```

Python:

```python
favoriteTimeFrames.Contains(timeFrame: TimeFrame) -> bool
```

### Parameters

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

### Returns

`bool` — 

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
if (!TimeFrameManager.Favorite.Contains(TimeFrame.Daily))
    TimeFrameManager.Favorite.Add(TimeFrame.Daily);
```

Python:

```python
if not api.TimeFrameManager.Favorite.Contains(TimeFrame.Daily):
    api.TimeFrameManager.Favorite.Add(TimeFrame.Daily)
```

