---
id: "M:cAlgo.API.CustomTimeFrame.GetBars(cAlgo.API.Internals.Symbol)"
kind: "method"
type: "T:cAlgo.API.CustomTimeFrame"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/TimeFrame/Custom/CustomTimeFrame/GetBars/"
---

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

# CustomTimeFrame.GetBars

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

## GetBars(Symbol symbol)

Returns bars of a symbol if exists otherwise null.

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
CustomBars GetBars(Symbol symbol)
```

Python:

```python
customTimeFrame.GetBars(symbol: Symbol) -> CustomBars
```

### Parameters

- `symbol` (`Symbol`, Python `Symbol`): Bars Symbol

### Returns

`CustomBars` — CustomBars

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
var customTimeFrame = TimeFrameManager.Custom.Add("My Custom TF");
var customBars = customTimeFrame.GetBars(Symbols.GetSymbol("EURUSD"));
if (customBars == null)
    Print("No custom bars added for EURUSD yet");
```

Python:

```python
customTimeFrame = api.TimeFrameManager.Custom.Add("My Custom TF")
customBars = customTimeFrame.GetBars(api.Symbols.GetSymbol("EURUSD"))
if customBars is None:
    api.Print("No custom bars added for EURUSD yet")
```

