Skip to content

Line

Summary

Represents the line shape.

Signature

1
public class Line : Shape

Namespace

cAlgo.API

Properties

Name Description
X1 { get; set; } Gets or sets x-axis point 1 data.
Y1 { get; set; } Gets or sets the y-axis point 2 data.
X2 { get; set; } Gets or sets the x-axis point 2 data.
Y2 { get; set; } Gets or sets the y-axis point 2 data.

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
27
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to draw a line shape on your chart
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class LineShapeSample : Indicator
     {
         protected override void Initialize()
         {
             var xCenter = Chart.Width / 2;
             var yCenter = Chart.Height / 2;
             var line = new Line
             {
                 X1 = xCenter,
                 X2 = xCenter + 100,
                 Y1 = yCenter,
                 Y2 = yCenter + 100,
                 StrokeColor = Color.Red,
                 StrokeThickness = 2
             };
             Chart.AddControl(line);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

Last update: July 1, 2022

Comments