---
id: "P:cAlgo.API.Indicator.IsLastBar"
kind: "property"
type: "T:cAlgo.API.Indicator"
url: "https://help.ctrader.com/ctrader-algo/references/General/Indicator/IsLastBar/"
---

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

# Indicator.IsLastBar

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

## IsLastBar

Returns true, if Calculate is invoked for the last bar

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

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

Python:

```python
api.IsLastBar: bool
```

### Returns

`bool` — 

### Examples

C#:

```csharp
if (IsLastBar)
    Print("Last bar index {0}, close {1}", index, Bars.ClosePrices[index]);
```

Python:

```python
def calculate(self, index):
    if api.IsLastBar:
        api.Print(f"Last bar index {index}, close {api.Bars.ClosePrices[index]}")
```

