---
id: "T:cAlgo.API.CustomTimeFrameBarsUnloadedEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/CustomTimeFrameBarsUnloadedEventArgs/"
---

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

# CustomTimeFrameBarsUnloadedEventArgs (class)

Provides data for custom time frame BarsUnloaded event.

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.

## Definition

```csharp
public class CustomTimeFrameBarsUnloadedEventArgs
```

Available since cAlgo.API 5.3.

## Examples

C#:

```csharp
protected override void OnStart()
{
    var customTimeFrame = TimeFrameManager.Custom.Add("My Time Frame");
    customTimeFrame.BarsUnloaded += OnCustomTimeFrameBarsUnloaded;
}

private void OnCustomTimeFrameBarsUnloaded(CustomTimeFrameBarsUnloadedEventArgs args)
{
    Print("{0} bars of {1} were unloaded", args.CustomBars.Symbol.Name, args.CustomTimeFrame.Name);
}
```

Python:

```python
def on_start(self):
    customTimeFrame = api.TimeFrameManager.Custom.Add("My Time Frame")
    customTimeFrame.BarsUnloaded += self.on_custom_time_frame_bars_unloaded

def on_custom_time_frame_bars_unloaded(self, args):
    api.Print(f"{args.CustomBars.Symbol.Name} bars of {args.CustomTimeFrame.Name} were unloaded")
```

## Properties

- `public CustomBars CustomBars {get;}` — Gets custom bars that was unloaded. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/CustomTimeFrameBarsUnloadedEventArgs/CustomBars/index.md)
- `public CustomTimeFrame CustomTimeFrame {get;}` — Gets custom time frame. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/CustomTimeFrameBarsUnloadedEventArgs/CustomTimeFrame/index.md)

