Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to get text string and brush color of text drawingtool

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

    Trying to get text string and brush color of text drawingtool

    I'm using:

    protected override void OnBarUpdate()
    {
    // Loops through the DrawObjects collection via a threadsafe list copy
    foreach (DrawingTool draw in DrawObjects.ToList())
    {
    if (draw is DrawingTools.Text)
    {
    ​DrawingTools.Text myText = draw as DrawingTools.Text;
    }
    }

    }

    I am unable to figure out how to get the actual text string and the color from MyText but can't figure it out.

    Please help.
    Jim


    #2
    Hello Jim,

    Thanks for your post.

    Please see the example script on the forum thread linked below which demonstrates getting a Drawing Object's properties, such as Brush color, by looping through the DrawObjects collection.

    https://ninjatrader.com/support/foru...54#post1231354

    Note that there are no documented means for getting the Text of a Draw.Text() object.

    DrawObjects: https://ninjatrader.com/support/help...rawobjects.htm
    DrawingTool Objects: https://ninjatrader.com/support/help...rawingtool.htm

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    167 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    88 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    128 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    208 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    185 views
    0 likes
    Last Post CarlTrading  
    Working...
    X