Skip to content

ChartText

Summary

Represents the Text chart object. Allows place the text anywhere on the chart, bound to the chart.

Signature

1
public abstract interface ChartText

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
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use Chart.DrawText method to draw text
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class ChartTextSample : Indicator
     {
         protected override void Initialize()
         {
             for (int iBarIndex = Chart.FirstVisibleBarIndex; iBarIndex <= Chart.LastVisibleBarIndex; iBarIndex++)
             {
                 string text;
                 double y;
                 Color color;
                 if (Bars.ClosePrices[iBarIndex] > Bars.OpenPrices[iBarIndex])
                 {
                     text = "U";
                     y = Bars.LowPrices[iBarIndex];
                     color = Color.Green;
                 }
                 else
                 {
                     text = "D";
                     y = Bars.HighPrices[iBarIndex];
                     color = Color.Red;
                 }
                 Chart.DrawText("Text_" + iBarIndex, text, iBarIndex, y, color);
             }
         }
         public override void Calculate(int index)
         {
         }
     }
 }

See Also

Properties

Time

Summary

Gets or sets the Time line value.

Signature

1
public abstract DateTime Time {get; set;}

Return Value

DateTime

Y

Summary

Gets or sets the Y-axis value.

Signature

1
public abstract double Y {get; set;}

Return Value

double

Color

Summary

Gets or sets the text color.

Signature

1
public abstract Color Color {get; set;}

Return Value

Color

Text

Summary

Gets or sets the text content.

Signature

1
public abstract string Text {get; set;}

Return Value

string

FontSize

Summary

Gets or sets the font size of text

Signature

1
public abstract double FontSize {get; set;}

Return Value

double

IsBold

Summary

Gets or sets if the text is Bold or not

Signature

1
public abstract bool IsBold {get; set;}

Return Value

bool

IsItalic

Summary

Gets or sets if the text is Italic or not

Signature

1
public abstract bool IsItalic {get; set;}

Return Value

bool

IsUnderlined

Summary

Gets or sets if the text is Underlined or not

Signature

1
public abstract bool IsUnderlined {get; set;}

Return Value

bool

VerticalAlignment

Summary

Gets or sets the vertical alignment of the text regarding the anchor point.

Signature

1
public abstract VerticalAlignment VerticalAlignment {get; set;}

Return Value

VerticalAlignment

HorizontalAlignment

Summary

Gets or sets the horizontal alignment of the text regarding the anchor point.

Signature

1
public abstract HorizontalAlignment HorizontalAlignment {get; set;}

Return Value

HorizontalAlignment