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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X