---
id: "P:cAlgo.API.CustomBarsNeedsMoreEventArgs.CustomBars"
kind: "property"
type: "T:cAlgo.API.CustomBarsNeedsMoreEventArgs"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/CustomBarsNeedsMoreEventArgs/CustomBars/"
---

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

# CustomBarsNeedsMoreEventArgs.CustomBars

Member of [CustomBarsNeedsMoreEventArgs](https://help.ctrader.com/ctrader-algo/references/EventArgs/CustomBarsNeedsMoreEventArgs/index.md).

## CustomBars

Gets custom bars that needs more bars.

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
public CustomBars CustomBars {get;}
```

Python:

```python
customBarsNeedsMoreEventArgs.CustomBars: CustomBars
```

### Returns

`CustomBars` — 

Available since cAlgo.API 5.3.

### Examples

C#:

```csharp
protected override void OnStart()
{
    var customTimeFrame = TimeFrameManager.Custom.Add("My Time Frame");
    var customBars = customTimeFrame.AddBars(Symbols.GetSymbol("EURUSD"));
    customBars.NeedsMore += OnCustomBarsNeedsMore;
}

private void OnCustomBarsNeedsMore(CustomBarsNeedsMoreEventArgs args)
{
    var customBars = args.CustomBars;
    Print("Loaded: {0}, bars count: {1}", customBars.IsLoaded, customBars.Bars.Count);
}
```

Python:

```python
def on_start(self):
    customTimeFrame = api.TimeFrameManager.Custom.Add("My Time Frame")
    customBars = customTimeFrame.AddBars(api.Symbols.GetSymbol("EURUSD"))
    customBars.NeedsMore += self.on_custom_bars_needs_more

def on_custom_bars_needs_more(self, args):
    customBars = args.CustomBars
    api.Print(f"Loaded: {customBars.IsLoaded}, bars count: {customBars.Bars.Count}")
```

