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

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

# BarOpenedEventArgs.Bars

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

## Bars

Gets the bar data.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public Bars Bars {get;}
```

Python:

```python
barOpenedEventArgs.Bars: Bars
```

### Returns

`Bars` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    Bars.BarOpened += OnBarsBarOpened;
}

private void OnBarsBarOpened(BarOpenedEventArgs args)
{
    Print("New bar opened at {0}, previous bar close: {1}", args.Bars.LastBar.OpenTime, args.Bars.Last(1).Close);
}
```

Python:

```python
def on_start(self):
    api.Bars.BarOpened += self.on_bars_bar_opened

def on_bars_bar_opened(self, args):
    api.Print(f"New bar opened at {args.Bars.LastBar.OpenTime}, previous bar close: {args.Bars.Last(1).Close}")
```

