Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT7 to NT8 Code Changes

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

    NT7 to NT8 Code Changes

    Hello

    Can you please help me transfer my code from NT7 to NT8 on some code parts which I did not succeed:

    1) if (itrDrawObject.DrawType == DrawType.VerticalLine)
    itrDrawObject used to be of type IDrawObject. I changed it to IDrawingTool but there are still errors.

    2) if (verticalLine.Pen.Color == Color.Red)
    verticalLineused to be of type IVerticalLine. I changed it to VerticalLinebut there are still errors.

    3)verticalLine.Time
    Again, verticalLineused to be of type IVerticalLine. I changed it to VerticalLinebut there are still errors.

    #2
    Hello kiss987,

    You haven't provided the needed context of how these are being declared.

    While you could cast as DrawingTool and compare this with DrawingTools.VerticalLine, if you plan to export this as a dll you would need to cast as dynamic types.

    Below is a public link to the help guide which details and provides example code on casting as dynamic.


    And a public link to the help guide on DrawObjects.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello

      I was able to convert sample 2 into:
      verticalLine.Pen.Color > verticalLine.Stroke.Brush

      However, I cannot find a way to make sure if it's red. When I print it to screen i get '#FF000000' which represents red, but I don't want to compare it to a string.

      Thanks

      Comment


        #4
        Hello kiss987,

        Not all brushes will have a standard color.

        You could do a comparison, however.

        if (verticalLine.Stroke.Brush == Brushes.Red)
        {
        // execute code
        }
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        598 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X