Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Converting DrawObject code from NT7 to NT8

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

    Converting DrawObject code from NT7 to NT8

    any BIG Hints so I don't have to spend hours with this? :-)

    (I'm not a C# expert...)


    #region CheckDrawObjects
    private void CheckDrawObjects()
    {
    foreach (IDrawObject draw in DrawObjects)
    {
    // select User Drawn Horizontal or Ray Lines, and BLACK
    if (draw.UserDrawn && (draw.DrawType == DrawType.Ray || draw.DrawType == DrawType.HorizontalLine))
    {
    //Sets some line properties programatically
    ILine ThisLine = (ILine) draw;
    if (ThisLine.Pen.Color == Color.Black
    || ThisLine.Pen.Color == Color.Cyan)
    {
    ProcessDrawObject(draw, ThisLine);
    }
    }
    }

    Thanks!

    #2
    Hello llanqui,

    Thanks for your post.

    in NT7 Color has been replaced with Brushes in NT8. IE: Brushes.Black You may want to review: https://ninjatrader.com/support/help...ng_changes.htm to better understand the changes.

    For looping through draw objects, please see the help guide and examples here: https://ninjatrader.com/support/help...rawobjects.htm

    Comment


      #3
      Well.... does anyone know if there is a NT8 indicator that senses when the price intersects a line or a ray?

      Even with this information it is not a small task for me to convert this

      Thank you

      Comment


        #4
        Hello llanqui,

        Thanks for your reply.

        I'm not aware of a specific indicator that would do this.

        Please see this thread on how to project the y axis of a ray (same would apply to a line): https://ninjatrader.com/support/foru...rossing-a-line.

        If you would like something created for you, we can provide a link to 3rd party programmers in the NinjaTrader Ecosystem who can provide the coding service.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 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
        548 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