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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    31 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    9 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    17 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X