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

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

# CustomSymbol.RemoveBars

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

## RemoveBars(TimeFrame timeFrame)

Removes bars of a time frame which has no user.

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

Python:

```python
customSymbol.RemoveBars(timeFrame: TimeFrame) -> bool
```

### Parameters

- `timeFrame` (`TimeFrame`, Python `TimeFrame`): Bars TimeFrame, it must be a built-in time frame not custom.

### Returns

`bool` — True if bars removed successfully otherwise false

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
var customSymbol = CustomSymbols.Add("MYEURUSD", Symbols.GetSymbol("EURUSD"));
customSymbol.AddBars(TimeFrame.Hour);
Print("Hourly custom bars removed: {0}", customSymbol.RemoveBars(TimeFrame.Hour));
```

Python:

```python
customSymbol = api.CustomSymbols.Add("MYEURUSD", api.Symbols.GetSymbol("EURUSD"))
customSymbol.AddBars(TimeFrame.Hour)
api.Print(f"Hourly custom bars removed: {customSymbol.RemoveBars(TimeFrame.Hour)}")
```

