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

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

# CustomTimeFrame.RemoveBars

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

## RemoveBars(Symbol symbol)

Removes bars of a symbol which is not being used.

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

Python:

```python
customTimeFrame.RemoveBars(symbol: Symbol) -> bool
```

### Parameters

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

### Returns

`bool` — True if bars removed successfully otherwise false

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
var customTimeFrame = TimeFrameManager.Custom.Add("My Custom TF");
var symbol = Symbols.GetSymbol("EURUSD");
customTimeFrame.AddBars(symbol);
Print("Custom bars removed: {0}", customTimeFrame.RemoveBars(symbol));
```

Python:

```python
customTimeFrame = api.TimeFrameManager.Custom.Add("My Custom TF")
symbol = api.Symbols.GetSymbol("EURUSD")
customTimeFrame.AddBars(symbol)
api.Print(f"Custom bars removed: {customTimeFrame.RemoveBars(symbol)}")
```

