Skip to content

ChartEllipse

Summary

Represent the Ellipse chart object.

Signature

1
public abstract interface ChartEllipse

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.
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.

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 indicator draw an ellipse on chart
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class ChartEllipseSample : Indicator
     {
         protected override void Initialize()
         {
             Draw();
         }
         public override void Calculate(int index)
         {
             Draw();
         }
         private void Draw()
         {
             var y1 = Bars.HighPrices[Chart.FirstVisibleBarIndex] > Bars.HighPrices[Chart.LastVisibleBarIndex] ? Bars.HighPrices[Chart.FirstVisibleBarIndex] : Bars.HighPrices[Chart.LastVisibleBarIndex];
             var y2 = Bars.LowPrices[Chart.FirstVisibleBarIndex] < Bars.LowPrices[Chart.LastVisibleBarIndex] ? Bars.LowPrices[Chart.FirstVisibleBarIndex] : Bars.LowPrices[Chart.LastVisibleBarIndex];
             var ellipse = Chart.DrawEllipse("ellipse", Chart.FirstVisibleBarIndex, y1, Chart.LastVisibleBarIndex, y2, Color.FromArgb(50, Color.Red.R, Color.Red.G, Color.Red.B));
             ellipse.IsFilled = true;
         }
     }
 }

See Also


Last update: July 1, 2022

Comments