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