Skip to content

ChartDragEventArgs

Summary

Provides data for the chart dragging event.

Signature

1
public class ChartDragEventArgs : ChartMouseEventArgs

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 using cAlgo.API;
 namespace cAlgo
 {
     // This example shows how to use the Chart ChartDragEventArgs
     // ChartDragEventArgs derives from ChartMouseEventArgs
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public 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 Started | 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 Ended | Mouse Location: ({2}, {3})", obj.Chart.SymbolName, obj.Chart.TimeFrame, obj.MouseX, obj.MouseY);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 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 Ended | Mouse Location: ({args.MouseX}, {args.MouseY})")
     def on_chart_drag_end(self, args):
         print(f"Chart {args.Chart.SymbolName} {args.Chart.TimeFrame} Drag Started | Mouse Location: ({args.MouseX}, {args.MouseY})")

See Also