• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    https://ninjatrader.com/support/help...assemblies.htm

    And a public link to the help guide on DrawObjects.
    https://ninjatrader.com/support/help...rawobjects.htm
    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 NinjaCustomer, Today, 10:06 AM
        3 responses
        6 views
        0 likes
        Last Post NinjaTrader_JoshG  
        Started by crabman777, Today, 09:52 AM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Arkadiy_B, Today, 06:43 AM
        0 responses
        4 views
        0 likes
        Last Post Arkadiy_B  
        Started by leontancfa, Today, 06:09 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by soulfx, 12-01-2017, 08:44 AM
        3 responses
        1,023 views
        0 likes
        Last Post NinjaTrader_EricB  
        Working...
        X