---
id: "P:cAlgo.API.CustomTimeFrameBarsNeededArgs.CustomTimeFrame"
kind: "property"
type: "T:cAlgo.API.CustomTimeFrameBarsNeededArgs"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomTimeFrameBarsNeededArgs/CustomTimeFrame/"
---

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

# CustomTimeFrameBarsNeededArgs.CustomTimeFrame

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

## CustomTimeFrame

Gets 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
public CustomTimeFrame CustomTimeFrame {get;}
```

Python:

```python
customTimeFrameBarsNeededArgs.CustomTimeFrame: CustomTimeFrame
```

### Returns

`CustomTimeFrame` — 

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
protected override void OnStart()
{
    TimeFrameManager.Custom.Add("My Custom TF").BarsNeeded = OnBarsNeeded;
}

private void OnBarsNeeded(CustomTimeFrameBarsNeededArgs args)
{
    Print("Custom time frame {0} needs bars", args.CustomTimeFrame.Name);
}
```

Python:

```python
from System import Action

def on_start(self):
    api.TimeFrameManager.Custom.Add("My Custom TF").BarsNeeded = Action[CustomTimeFrameBarsNeededArgs](self.on_bars_needed)

def on_bars_needed(self, args):
    api.Print(f"Custom time frame {args.CustomTimeFrame.Name} needs bars")
```

