Skip to content

ChartTriangle

Summary

Represents the Triangle chart object.

Signature

1
public abstract interface ChartTriangle

Namespace

cAlgo.API

Properties

Name Description
Time1 { get; set; } Gets or sets the value 1 on the Time line.
Time2 { get; set; } Gets or sets the value 2 on the Time line.
Time3 { get; set; } Gets or sets the value 3 on the Time line.
Y1 { get; set; } Gets or sets the value 1 on the Y-axis.
Y2 { get; set; } Gets or sets the value 2 on the Y-axis.
Y3 { get; set; } Gets or sets the value 3 on the Y-axis.

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
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to draw a triangle on chart with Chart.DrawTriangle method
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class ChartTriangleSample : Indicator
     {
         protected override void Initialize()
         {
             var x1 = Chart.FirstVisibleBarIndex;
             var x2 = Chart.FirstVisibleBarIndex + ((Chart.LastVisibleBarIndex - Chart.FirstVisibleBarIndex) / 2);
             var x3 = Chart.LastVisibleBarIndex;
             var y1 = Bars.LowPrices[x1];
             var y2 = Bars.LowPrices.Minimum(Chart.LastVisibleBarIndex - Chart.FirstVisibleBarIndex);
             var y3 = Bars.HighPrices[x3];
             var triangle = Chart.DrawTriangle("triangle_sample", x1, y1, x2, y2, x3, y3, Color.FromArgb(100, Color.Red), 2, LineStyle.Dots);
             triangle.IsInteractive = true;
             triangle.IsFilled = true;
         }
         public override void Calculate(int index)
         {
         }
     }
 }

See Also


Last update: July 1, 2022

Comments