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

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

# ChartScrollEventArgs (class)

Provides data for the chart scrolling event.

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

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

## Definition

```csharp
public class ChartScrollEventArgs
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the Chart ChartScrollEventArgs
    public partial class ChartScrollEventArgsSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.ScrollChanged += Chart_ScrollChanged;
        }

        private void Chart_ScrollChanged(ChartScrollEventArgs obj)
        {
            Print("Scrolled, Bars Delta : {0} | Top Y Delta: {1} | Bottom Y Delta: {2}", obj.BarsDelta, obj.TopYDelta, obj.BottomYDelta);
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        api.Chart.ScrollChanged += self.on_chart_scroll_changed

    def on_chart_scroll_changed(self, args):
        print(f"Scrolled, Bars Delta : {args.BarsDelta} | Top Y Delta: {args.TopYDelta} | Bottom Y Delta: {args.BottomYDelta}")
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Properties

- `public int BarsDelta {get;}` — Gets a value that indicates the amount of bars that the chart was scrolled for [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartScrollEventArgs/BarsDelta/index.md)
- `public double BottomYDelta {get;}` — Gets the lowest value of the bars delta. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartScrollEventArgs/BottomYDelta/index.md)
- `public Chart Chart {get;}` — Gets the chart. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartScrollEventArgs/Chart/index.md)
- `public ChartArea ChartArea {get;}` — Gets the chart area. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartScrollEventArgs/ChartArea/index.md)
- `public double TopYDelta {get;}` — Gets the highest value of the bars delta. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartScrollEventArgs/TopYDelta/index.md)

