Skip to content

IndicatorAreaAddedEventArgs

Summary

Provides data for the indicator area adding event.

Signature

1
public class IndicatorAreaAddedEventArgs : IndicatorAreaEventArgs

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
 using cAlgo.API;
 namespace cAlgo
 {
     // This example shows how to use the IndicatorAreaAddedEventArgs
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class IndicatorAreaAddedEventArgsSample : Indicator
     {
         protected override void Initialize()
         {
             ShowIndicatorAreasCount();
             Chart.IndicatorAreaAdded += Chart_IndicatorAreaAdded;
         }
         private void Chart_IndicatorAreaAdded(IndicatorAreaAddedEventArgs obj)
         {
             Print("A new indicator area has been added");
             ShowIndicatorAreasCount();
         }
         private void ShowIndicatorAreasCount()
         {
             var text = string.Format("Indicator Areas #: {0}", Chart.IndicatorAreas.Count);
             Chart.DrawStaticText("text", text, VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

See Also


Last update: July 1, 2022

Comments