Skip to content

ChartRectangle

Summary

Represents the Rectangle chart object. A rectangle of any preferable size and rotation that can be drawn directly in the chart, bound to X-Y axises.

Signature

1
public abstract interface ChartRectangle

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
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use Chart.DrawRectangle method to draw a rectangle
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class ChartRectangleSample : Indicator
     {
         protected override void Initialize()
         {
             var period = Chart.LastVisibleBarIndex - Chart.FirstVisibleBarIndex;
             var rectangle = Chart.DrawRectangle("rectangle_sample", Chart.FirstVisibleBarIndex, Bars.LowPrices.Minimum(period), Chart.LastVisibleBarIndex, Bars.HighPrices.Maximum(period), Color.FromArgb(100, Color.Red));
             rectangle.IsFilled = true;
             rectangle.IsInteractive = true;
         }
         public override void Calculate(int index)
         {
         }
     }
 }

See Also


Last update: July 1, 2022

Comments