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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    41 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    27 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    45 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    37 views
    0 likes
    Last Post CarlTrading  
    Working...
    X