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

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

# CustomTimeFrame.RemoveAllUnloadedBars

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

## RemoveAllUnloadedBars()

Removes all existing unloaded custom bars that aren't 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
void RemoveAllUnloadedBars()
```

Python:

```python
customTimeFrame.RemoveAllUnloadedBars() -> None
```

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
var customTimeFrame = TimeFrameManager.Custom.Get("My Custom TF");
customTimeFrame?.RemoveAllUnloadedBars();
```

Python:

```python
customTimeFrame = api.TimeFrameManager.Custom.Get("My Custom TF")
if customTimeFrame is not None:
    customTimeFrame.RemoveAllUnloadedBars()
```

