Skip to content

ChartIcon

Summary

Represents the Icon chart object.

Signature

1
public abstract interface ChartIcon

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 sample indicator shows how to use Chart.DrawIcon method to draw icons
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class ChartIconSample : Indicator
     {
         protected override void Initialize()
         {
             for (int i = Chart.FirstVisibleBarIndex; i <= Chart.LastVisibleBarIndex; i++)
             {
                 var iconName = string.Format("Icon_{0}", i);
                 if (Bars.ClosePrices[i] > Bars.OpenPrices[i])
                 {
                     Chart.DrawIcon(iconName, ChartIconType.UpArrow, i, Bars.LowPrices[i], Color.Green);
                 }
                 else
                 {
                     Chart.DrawIcon(iconName, ChartIconType.DownArrow, i, Bars.HighPrices[i], Color.Red);
                 }
             }
         }
         public override void Calculate(int index)
         {
         }
     }
 }

See Also

Properties

IconType

Summary

Gets or sets the type of the icon.

Signature

1
public abstract ChartIconType IconType {get; set;}

Return Value

ChartIconType

Time

Summary

Gets or sets the Time value of the icon location.

Signature

1
public abstract DateTime Time {get; set;}

Return Value

DateTime

Y

Summary

Gets or sets the Y-axis value of the icon location.

Signature

1
public abstract double Y {get; set;}

Return Value

double

Color

Summary

Gets or sets the color of the icon.

Signature

1
public abstract Color Color {get; set;}

Return Value

Color