Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get properties from a Text object drawn on chart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Get properties from a Text object drawn on chart

    Hello guys,

    I have an indicator that draws Text objects on chart. I want to be able to read from code, the string that is drawn on the chart, the text color, font, etc.

    Currently Im detecting that object using:

    foreach (DrawingTool draw in DrawObjects.ToList())
    {

    if(draw.Name == "Text") Print("Name: "+draw.Name);

    }

    But the only parameter I'm extracting now is the Name of the object. I want to read the font color, also the actual string content.

    Please help!​

    #2
    Hello facuevasm,

    Thank you for your post.

    To get the color and actual string context of the Text object, you would need to do something like below:

    Code:
    for (int index = 0; index < drawingTools.Count; index++)
    {
    if (drawingTools[index] is DrawingTools.Text)
    {
    DrawingTools.Text myDrawText = drawingTools[index] as DrawingTools.Text;
    
    Print(myDrawText.TextBrush);
    Print(myDrawText.DisplayText);
    }
    }​
    Please let us know if you have any further questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    64 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    93 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    48 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    106 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    63 views
    0 likes
    Last Post PaulMohn  
    Working...
    X