Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by GLFX005, Today, 03:23 AM
    0 responses
    2 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    11 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    6 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    14 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    3 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Working...
    X