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

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

# BarsTickEventArgs (class)

Provides data for the tick bar event.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public class BarsTickEventArgs
```

## Examples

C#:

```csharp
protected override void OnStart()
{
    Bars.Tick += OnBarsTick;
}

private void OnBarsTick(BarsTickEventArgs args)
{
    var lastBar = args.Bars.LastBar;
    Print("{0} {1} tick | Close: {2} | First tick of a new bar: {3}", args.Bars.SymbolName, args.Bars.TimeFrame, lastBar.Close, args.IsBarOpened);
}
```

Python:

```python
def on_start(self):
    api.Bars.Tick += self.on_bars_tick

def on_bars_tick(self, args):
    last_bar = args.Bars.LastBar
    api.Print(f"{args.Bars.SymbolName} {args.Bars.TimeFrame} tick | Close: {last_bar.Close} | First tick of a new bar: {args.IsBarOpened}")
```

## Properties

- `public Bars Bars {get;}` — Gets the Bar objects data. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/BarsTickEventArgs/Bars/index.md)
- `public bool IsBarOpened {get;}` — Defines if current tick is the first tick of a new bar. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/BarsTickEventArgs/IsBarOpened/index.md)

