Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I want to get the style of an existing drawing line

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

    I want to get the style of an existing drawing line

    Hello,
    I wantted to iterate for each drawing line in the chart and depending of the line style (colo and line of dot for example) I want to do something in particular.
    I am iterating all the drawing line with the following peace of code, but I am not able to get the brush that was used in order to create this.

    foreach (DrawingTool draw in DrawObjects.ToList())

    How can I get the line style including color and line type from draw object?
    With this information I want to draw another line with the same style.

    Thank you so much.


    #2
    Hello Nutriax,

    You would need to look at the individual tool and see what properties it uses for the color you wanted to change or detect. The DrawingTool type is a generic base object so that won't have any specific brushes, you would need to refer to the help guide sample and how it casts objects into a specific type within the loop. When you have an object of a specific type like Line you could access its specific properties like its Brush property. https://ninjatrader.com/support/help.../draw_line.htm




    Please let me know if I can be of additional help.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    68 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    150 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X