ChartStaticText
interface cAlgo.API
DesktopCLICloud
Represents the chart static text.
Environment behaviour
CLI — works differently. Created and kept with all its properties, but never drawn: the CLI displays no chart.
Cloud — works differently. Created and kept with all its properties, but never drawn: the cloud displays no chart.
Definition
public interface ChartStaticText
Namespace: cAlgo.API · Group: Drawings · Implements: ChartObject
Examples
using cAlgo.API;
using System.Text;
namespace cAlgo
{
// This sample shows how to use Chart.DrawStaticText method to draw static locked text on chart
public partial 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)
{
}
}
}
import clr
clr.AddReference("cAlgo.API")
from cAlgo.API import *
class Test():
def initialize(self):
text = f"Symbol: {api.SymbolName}\nTimeFrame: {api.TimeFrame}\nChart Type: {api.Chart.ChartType}"
api.Chart.DrawStaticText("Static_Sample", text, VerticalAlignment.Bottom, HorizontalAlignment.Left, Color.Red)
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true
}
Properties
| Name | Description |
|---|---|
ColorDesktopCLICloudColor | Gets or sets the chart static text color. |
FontFamilyDesktopCLICloudstring | Gets or sets the font style of the text. |
FontSizeDesktopCLIClouddouble | Gets or sets the font size of text |
HorizontalAlignmentDesktopCLICloudHorizontalAlignment | Gets or sets the chart static text horizontal alignment. |
IsBoldDesktopCLICloudbool | Gets or sets if the text is Bold or not |
IsItalicDesktopCLICloudbool | Gets or sets if the text is Italic or not |
IsUnderlinedDesktopCLICloudbool | Gets or sets if the text is Underlined or not |
TextDesktopCLICloudstring | Gets or sets the chart static text content. |
VerticalAlignmentDesktopCLICloudVerticalAlignment | Gets or sets the chart static text vertical alignment. |
Inherited members
From ChartObject: Name, Comment, ObjectType, IsInteractive, IsLocked, IsHidden, ZIndex, IsAlive