Skip to content

IndicatorArea

Summary

Represents the area where the Indicator is placed.

Signature

1
public abstract interface IndicatorArea

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample indicator shows how to use IndicatorArea
     [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class IndicatorAreaSample : Indicator
     {
         private TextBlock _indicatorAreaNumberTextBlock;
         protected override void Initialize()
         {
             var grid = new Grid(1, 2)
             {
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 BackgroundColor = Color.Gold,
                 Opacity = 0.7,
                 Width = 200
             };
             grid.AddChild(new TextBlock { Text = "Indicator Area #", Margin = 5, FontWeight = FontWeight.ExtraBold, ForegroundColor = Color.Black }, 0, 0);
             _indicatorAreaNumberTextBlock = new TextBlock
             {
                 Margin = 5,
                 Text = Chart.IndicatorAreas.Count.ToString(),
                 FontWeight = FontWeight.ExtraBold,
                 ForegroundColor = Color.Black
             };
             grid.AddChild(_indicatorAreaNumberTextBlock, 0, 1);
             IndicatorArea.AddControl(grid);
             Chart.IndicatorAreaAdded += Chart_IndicatorAreaAdded;
             Chart.IndicatorAreaRemoved += Chart_IndicatorAreaRemoved;
         }
         private void Chart_IndicatorAreaRemoved(IndicatorAreaRemovedEventArgs obj)
         {
             _indicatorAreaNumberTextBlock.Text = Chart.IndicatorAreas.Count.ToString();
         }
         private void Chart_IndicatorAreaAdded(IndicatorAreaAddedEventArgs obj)
         {
             _indicatorAreaNumberTextBlock.Text = Chart.IndicatorAreas.Count.ToString();
         }
         public override void Calculate(int index)
         {
         }
     }
 }

See Also


Last update: July 1, 2022

Comments