Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compilation errors caused by deprecated NinjaScript

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

    Compilation errors caused by deprecated NinjaScript

    NinjaScript which compiles in NT 6.5 will fail in NT 7 if any of the below depreciated NinjaScript is encountered by NT 7. Note: This list is not exhaustive. I have more to add.

    SimpleTimeZone.ToUniversalTime(System.DateTime)
    Param 1=time

    Indicator.IndicatorBase.DrawText(System.String,Sys tem.String,System.Int32,System.Double,
    System.Drawing.Color,System.Drawing.Font,
    System.Drawing.StringAlignment,System.Drawing.Colo r,
    System.Drawing.Color,System.Int32)

    Deprecated method signature.
    Param 1=tag
    <-- bool autoScale required
    Param 2=text
    Param 3=barsAgo
    Param 4=y
    <-- int yPixelOffset required
    Param 5=textColor
    Param 6=font
    Param 7=alignment
    Param 8=outlineColor
    Param 9=backColor
    Param 10=opacity

    Indicator.IndicatorBase.DrawText(System.String,Sys tem.Boolean,System.String,System.Int32,
    System.Double,System.Drawing.Color,System.Drawing. Font,
    System.Drawing.StringAlignment,System.Drawing.Colo r,
    System.Drawing.Color,System.Int32)

    Deprecated method signature.
    Param 1=tag
    Param 2=autoScale
    Param 3=text
    Param 4=barsAgo
    Param 5=y
    <-- int yPixelOffset required
    Param 6=textColor
    Param 7=font
    Param 8=alignment
    Param 9=outlineColor
    Param 10=backColor
    Param 11=opacity

    Data.Bars.CurrentAsk Deprecated. Use GetCurrentAsk instead.
    Data.Bars.CurrentAskVolume Deprecated. Use GetCurrentAskVolume instead.
    Data.Bars.CurrentBid Deprecated. Use GetCurrentBid instead.
    Data.Bars.CurrentBidVolume Deprecated. Use GetCurrentBidVolume instead.

    Strategy.StrategyBase.DrawText(System.String,Syste m.String,System.Int32,System.Double,
    System.Drawing.Color,System.Drawing.Font,System.
    Drawing.StringAlignment,System.Drawing.Color,Syste m.Drawing.Color,
    System.Int32)

    Deprecated method signature.
    Param 1=tag
    <-- bool autoScale required
    Param 2=text
    Param 3=barsAgo
    Param 4=y
    <-- int yPixelOffset required
    Param 5=textColor
    Param 6=font
    Param 7=alignment
    Param 8=outlineColor
    Param 9=backColor
    Param 10=opacity

    Strategy.StrategyBase.DrawText(System.String,Syste m.Boolean,System.String,System.Int32,
    System.Double,System.Drawing.Color,System.Drawing. Font,
    System.Drawing.StringAlignment,System.Drawing.Colo r,
    System.Drawing.Color,System.Int32)

    Deprecated method signature.
    Param 1=tag
    Param 2=autoScale
    Param 3=text
    Param 4=bar
    Param 5=y
    <-- int yPixelOffset required
    Param 6=textColor
    Param 7=font
    Param 8=alignment
    Param 9=outlineColor
    Param 10=backColor
    Param 11=opacity
    Last edited by Jim W.; 12-31-2009, 09:19 AM. Reason: Added parameters that must be added

    #2
    Thanks. In case you're not aware: as a beta user you should have received a document holding a section "Code breaking changes". This section should hold the information you are referring to.

    Comment


      #3
      I have read that document again and did not find mention that the deprecated DrawXxx overloads that did not have autoScale or autoScale and yPixelOffset have been removed in NT7.

      My first compile flagged over 1000 statement that had to be corrected. Easy to add but it took a while. Went much faster when I realized that I should make the changes bottom to top so the next change was not covered by the popup.

      Comment


        #4
        Below are the remaing DrawXx deprecated overloads that are not in NT7. In some cases, inserting the bool autoScale parameter after the first parameter is all that is required. This list plus my first post covers all the DrawXx methods. I will check the others when I can find the time.

        Indicator.IndicatorBase.DrawAndrewsPitchfork(Syste m.String,System.Int32,System.Double,System.Int32,S ystem.Double,System.Int32,System.Double)

        Indicator.IndicatorBase.DrawDiamond(System.String, System.Int32,System.Double,System.Drawing.Color)

        Indicator.IndicatorBase.DrawDot(System.String,Syst em.Int32,System.Double,System.Drawing.Color)

        Indicator.IndicatorBase.DrawEllipse(System.String, System.Int32,System.Double,System.Int32,System.Dou ble,System.Drawing.Color,System.Drawing.Color,Syst em.Int32)

        Indicator.IndicatorBase.DrawExtendedLine(System.St ring,System.Int32,System.Double,System.Int32,Syste m.Double,System.Drawing.Color,System.Drawing.Drawi ng2D.DashStyle,System.Int32)

        Indicator.IndicatorBase.DrawExtendedLine(System.St ring,System.Int32,System.Double,System.Int32,Syste m.Double,System.Drawing.Color,System.Drawing.Drawi ng2D.DashStyle,System.Int32)

        Indicator.IndicatorBase.DrawFibonacciExtensions(Sy stem.String,System.Int32,System.Double,System.Int3 2,System.Double,System.Int32,System.Double)

        Indicator.IndicatorBase.DrawFibonacciExtensions(Sy stem.String,System.Int32,System.Double,System.Int3 2,System.Double,System.Int32,System.Double)

        Indicator.IndicatorBase.DrawFibonacciRetracements( System.String,System.Int32,System.Double,System.In t32,System.Double)

        Indicator.IndicatorBase.DrawHorizontalLine(System. String,System.Double,System.Drawing.Color,System.D rawing.Drawing2D.DashStyle,System.Int32)

        Indicator.IndicatorBase.DrawLine(System.String,Sys tem.Int32,System.Double,System.Int32,System.Double ,System.Drawing.Color,System.Drawing.Drawing2D.Das hStyle,System.Int32)

        Indicator.IndicatorBase.DrawRay(System.String,Syst em.Int32,System.Double,System.Int32,System.Double, System.Drawing.Color,System.Drawing.Drawing2D.Dash Style,System.Int32)

        Indicator.IndicatorBase.DrawRectangle(System.Strin g,System.Int32,System.Double,System.Int32,System.D ouble,System.Drawing.Color,System.Drawing.Color,Sy stem.Int32)

        Indicator.IndicatorBase.DrawSquare(System.String,S ystem.Int32,System.Double,System.Drawing.Color)

        Indicator.IndicatorBase.DrawTriangleDown(System.St ring,System.Int32,System.Double,System.Drawing.Col or)

        Indicator.IndicatorBase.DrawTriangleUp(System.Stri ng,System.Int32,System.Double,System.Drawing.Color )

        Strategy.StrategyBase.DrawAndrewsPitchfork(System. String,System.Int32,System.Double,System.Int32,Sys tem.Double,System.Int32,System.Double)

        Strategy.StrategyBase.DrawDiamond(System.String,Sy stem.Int32,System.Double,System.Drawing.Color)

        Strategy.StrategyBase.DrawDot(System.String,System .Int32,System.Double,System.Drawing.Color)

        Strategy.StrategyBase.DrawEllipse(System.String,Sy stem.Int32,System.Double,System.Int32,System.Doubl e,System.Drawing.Color,System.Drawing.Color,System .Int32)

        Strategy.StrategyBase.DrawExtendedLine(System.Stri ng,System.Int32,System.Double,System.Int32,System. Double,System.Drawing.Color,System.Drawing.Drawing 2D.DashStyle,System.Int32)

        Strategy.StrategyBase.DrawFibonacciCircle(System.S tring,System.Boolean,System.Int32,System.Double,Sy stem.Int32,System.Double)

        Strategy.StrategyBase.DrawFibonacciExtensions(Syst em.String,System.Int32,System.Double,System.Int32, System.Double,System.Int32,System.Double)

        Strategy.StrategyBase.DrawFibonacciRetracements(Sy stem.String,System.Int32,System.Double,System.Int3 2,System.Double)

        Strategy.StrategyBase.DrawHorizontalLine(System.St ring,System.Double,System.Drawing.Color,System.Dra wing.Drawing2D.DashStyle,System.Int32)

        Strategy.StrategyBase.DrawLine(System.String,Syste m.Int32,System.Double,System.Int32,System.Double,S ystem.Drawing.Color,System.Drawing.Drawing2D.DashS tyle,System.Int32)

        Strategy.StrategyBase.DrawRay(System.String,System .Int32,System.Double,System.Int32,System.Double,Sy stem.Drawing.Color,System.Drawing.Drawing2D.DashSt yle,System.Int32)

        Strategy.StrategyBase.DrawRectangle(System.String, System.Int32,System.Double,System.Int32,System.Dou ble,System.Drawing.Color,System.Drawing.Color,Syst em.Int32)

        Strategy.StrategyBase.DrawSquare(System.String,Sys tem.Int32,System.Double,System.Drawing.Color)

        Strategy.StrategyBase.DrawTriangleDown(System.Stri ng,System.Int32,System.Double,System.Drawing.Color )

        Strategy.StrategyBase.DrawTriangleUp(System.String ,System.Int32,System.Double,System.Drawing.Color)
        Last edited by Jim W.; 12-31-2009, 09:49 AM.

        Comment


          #5
          Jim, another method to rapidly change a huge number of entries is to use the find and replace dialogue by hitting Ctrl + F and inputting the text you want it to search for and the text you want to replace it with. Then you can just click replace all and it will do it near instantly.
          AustinNinjaTrader Customer Service

          Comment


            #6
            Austin,

            Thanks for the suggestion. However, inserting text between the tag and text parameters makes find and replace difficult in this case. I could have used some editors that i have that support find and replace with regular expressions but decided not to do it that way. Also, I considered creating my own overloads which would have been the easiest way to handle the errors. I just decided to bite the bullet.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            600 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            346 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
            558 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            558 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X