Skip to content

ChartScrollEventArgs.BarsDelta

property · ChartScrollEventArgs · cAlgo.API

DesktopCLICloud

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

Environment behaviour

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

Definition

public int BarsDelta {get;}
chartScrollEventArgs.BarsDelta: int

Returns int

Examples

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);
}
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")