ChartStaticText


Summary

Represents the chart static text.

Syntax

public interface ChartStaticText : ChartObject

Members

NameTypeSummary
Color PropertyGets or sets the chart static text color.
HorizontalAlignment PropertyGets or sets the chart static text horizontal alignment.
Text PropertyGets or sets the chart static text content.
VerticalAlignment PropertyGets or sets the chart static text vertical alignment.

Example 1

using cAlgo.API;
using System.Text;
namespace cAlgo
{
    // This sample shows how to use Chart.DrawStaticText method to draw static locked text on chart
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class ChartStaticTextSample : Indicator
    {
        protected override void Initialize()
        {
            var stringBuilder = new StringBuilder();
            stringBuilder.AppendLine("Symbol: " + SymbolName);
            stringBuilder.AppendLine("TimeFrame: " + TimeFrame);
            stringBuilder.AppendLine("Chart Type: " + Chart.ChartType);
            Chart.DrawStaticText("Static_Sample", stringBuilder.ToString(), VerticalAlignment.Bottom, HorizontalAlignment.Left, Color.Red);
        }
        public override void Calculate(int index)
        {
        }
    }
}
Reference