Skip to content

ChartDragEventArgs

class cAlgo.API

DesktopCLICloud

Provides data for the chart dragging event.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (ChartArea.Drag, ChartArea.DragEnd, ChartArea.DragStart).

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

Definition

public class ChartDragEventArgs : ChartMouseEventArgs

Namespace: cAlgo.API · Group: EventArgs · Inherits: ChartMouseEventArgs

Examples

using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the Chart ChartDragEventArgs
    // ChartDragEventArgs derives from ChartMouseEventArgs
    public partial class ChartDragEventArgsSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.DragStart += Chart_DragStart;
            Chart.DragEnd += Chart_DragEnd;
        }

        private void Chart_DragEnd(ChartDragEventArgs obj)
        {
            Print("Chart {0} {1} Drag Ended | Mouse Location: ({2}, {3})", obj.Chart.SymbolName, obj.Chart.TimeFrame, obj.MouseX, obj.MouseY);
        }

        private void Chart_DragStart(ChartDragEventArgs obj)
        {
            Print("Chart {0} {1} Drag Started | Mouse Location: ({2}, {3})", obj.Chart.SymbolName, obj.Chart.TimeFrame, obj.MouseX, obj.MouseY);
        }

        public override void Calculate(int index)
        {
        }
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        api.Chart.DragStart += self.on_chart_drag_start
        api.Chart.DragEnd += self.on_chart_drag_end

    def on_chart_drag_start(self, args):
        print(f"Chart {args.Chart.SymbolName} {args.Chart.TimeFrame} Drag Started | Mouse Location: ({args.MouseX}, {args.MouseY})")

    def on_chart_drag_end(self, args):
        print(f"Chart {args.Chart.SymbolName} {args.Chart.TimeFrame} Drag Ended | Mouse Location: ({args.MouseX}, {args.MouseY})")
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Inherited members

From ChartMouseEventArgs: Chart, ChartArea, MouseX, MouseY, TimeValue, BarIndex, YValue, CtrlKey, ShiftKey, AltKey

See also