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

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

# CustomTimeFrames.Add

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

## Add(string name)

Adds a new custom time frame.

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
CustomTimeFrame Add(string name)
```

Python:

```python
customTimeFrames.Add(name: str) -> CustomTimeFrame
```

### Parameters

- `name` (`string`, Python `str`): Custom time frame unique name.

### Returns

`CustomTimeFrame` — CustomTimeFrame

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
var customTimeFrame = TimeFrameManager.Custom.Add("My Custom TF");
customTimeFrame.Description = "Bars provided by my plugin";
Print("Added custom time frame {0}", customTimeFrame.Name);
```

Python:

```python
customTimeFrame = api.TimeFrameManager.Custom.Add("My Custom TF")
customTimeFrame.Description = "Bars provided by my plugin"
api.Print(f"Added custom time frame {customTimeFrame.Name}")
```

