Skip to content

ChartScrollEventArgs

class cAlgo.API

DesktopCLICloud

Provides data for the chart scrolling event.

Environment behaviour

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

Definition

public class ChartScrollEventArgs

Namespace: cAlgo.API · Group: EventArgs

Examples

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)
        {
        }
    }
}
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}")
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Properties

Name Description
BarsDeltaDesktopCLICloudint Gets a value that indicates the amount of bars that the chart was scrolled for
BottomYDeltaDesktopCLIClouddouble Gets the lowest value of the bars delta.
ChartDesktopCLICloudChart Gets the chart.
ChartAreaDesktopCLICloudChartArea Gets the chart area.
TopYDeltaDesktopCLIClouddouble Gets the highest value of the bars delta.

See also