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

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

# ChartMouseWheelEventArgs.Delta

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

## Delta

Gets the number of detents the mouse wheel has rotated. A detent is one notch of the mouse wheel.

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

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

C#:

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

Python:

```python
chartMouseWheelEventArgs.Delta: int
```

### Returns

`int` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    Chart.MouseWheel += OnChartMouseWheel;
}

private void OnChartMouseWheel(ChartMouseWheelEventArgs args)
{
    var direction = args.Delta > 0 ? "up" : "down";
    Print("Mouse wheel scrolled {0} by {1} detents", direction, Math.Abs(args.Delta));
}
```

Python:

```python
def on_start(self):
    api.Chart.MouseWheel += self.on_chart_mouse_wheel

def on_chart_mouse_wheel(self, args):
    direction = "up" if args.Delta > 0 else "down"
    api.Print(f"Mouse wheel scrolled {direction} by {abs(args.Delta)} detents")
```

