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

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

# BarsTickEventArgs.IsBarOpened

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

## IsBarOpened

Defines if current tick is the first tick of a new bar.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public bool IsBarOpened {get;}
```

Python:

```python
barsTickEventArgs.IsBarOpened: bool
```

### Returns

`bool` — 

### Examples

C#:

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

private void OnBarsTick(BarsTickEventArgs args)
{
    if (args.IsBarOpened)
        Print("New bar opened at {0}", args.Bars.LastBar.OpenTime);
}
```

Python:

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

def on_bars_tick(self, args):
    if args.IsBarOpened:
        api.Print(f"New bar opened at {args.Bars.LastBar.OpenTime}")
```

