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

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

# ChartScrollEventArgs.BarsDelta

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

## BarsDelta

Gets a value that indicates the amount of bars that the chart was scrolled for

Environments: Desktop supported · CLI supported · Cloud not supported.

- Cloud: Never raised in the cloud: the events that pass it never fire there (ChartArea.ScrollChanged).

C#:

```csharp
public int BarsDelta {get;}
```

Python:

```python
chartScrollEventArgs.BarsDelta: int
```

### Returns

`int` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    Chart.ScrollChanged += OnChartScrollChanged;
}

private void OnChartScrollChanged(ChartScrollEventArgs args)
{
    if (args.BarsDelta != 0)
        Print("Chart scrolled horizontally by {0} bars", args.BarsDelta);
}
```

Python:

```python
def on_start(self):
    api.Chart.ScrollChanged += self.on_chart_scroll_changed

def on_chart_scroll_changed(self, args):
    if args.BarsDelta != 0:
        api.Print(f"Chart scrolled horizontally by {args.BarsDelta} bars")
```

