Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

drawing tool color

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

    drawing tool color

    Hello Gaby,
    I have a related question.
    I have a vendor indicator that created their own drawing tool type.
    I would like to get as much info as I can about the object. Especially the color.
    I can access the tag.
    How can I find the color?

    #2
    Hello saturntd,

    Thank you for your post.

    I have moved your post into it's own thread since it was unrelated to the previous thread.

    If you need a specific property from a specific type of object you would need to cast to that object in your script and then you could access the specific property, such as the TextBrush property of a Text drawing object by using something like myDrawText.TextBrush.

    For example, if the drawing object was a Text object:

    Code:
    foreach (DrawingTool draw in DrawObjects.ToList())
    {
    if (draw is DrawingTools.Text)
    {
    DrawingTools.Text myDrawText = draw as DrawingTools.Text;
    
    Print("Text object: " + myDrawText.Tag + " TextBrush: " + myDrawText.TextBrush);
    }
    }


    If the script is creating their own custom drawing object, you would need to know what kind type of drawing object they have created so you could cast to that object in the script.

    See the 'Looping through the collection to find specific draw objects' section of this help guide page for more sample code: https://ninjatrader.com/support/help...rawobjects.htm

    Please let me know if you have any further questions.

    Comment


      #3
      Thanks for the help Gaby, I'll try that.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      265 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      169 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      171 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      259 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      210 views
      0 likes
      Last Post CarlTrading  
      Working...
      X