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