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

NinjaScript Delete Warning

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

    NinjaScript Delete Warning

    While trying to delete a self-created strategy, I am getting the following error message.
    "You have custom NinjaScript files on your PC that have programming errors. These errors must be resolved before you can delete a NinjaScript File."

    How can I find error and resolve the issue? The error message does not direct me to a specific file.

    Sami

    #2
    Open any strategy, compile it, a list of errors and associated file(s) will be listed in the bottom of the NinjaScript Editor.
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray,

      Thanks for the reply. After compiling the strategies I got the following error description.

      "The name 'Max' does not exist in the current context Strategy"

      This relates to my other post regarding the maximum high of last 20 bars. My code is as below.

      if (High[0] <= Max(High,20)[1])
      {
      DrawArrowUp(
      "My up arrow" + CurrentBar, 0, 0, Color.Green);
      }

      Can you point out what error I have made in the above code?

      Sami

      Comment


        #4
        I think you want to be using Bars.HighestBar instead of Max. If you decide Max is what you want to be using you should use Math.Max().


        For HighestBar I believe this will work to your likings:
        Code:
        [FONT=Courier New][SIZE=2]if(High[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] <= High[Bars.HighestBar(20)][/SIZE][/FONT][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          uacvax,

          Bars.HighestBar worked great.

          Thanks,

          Sami

          Comment


            #6
            Its

            MAX()

            not

            Max()

            Note: The capitilization.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by traderqz, Yesterday, 09:06 AM
            3 responses
            21 views
            0 likes
            Last Post NinjaTrader_ThomasC  
            Started by f.saeidi, Today, 10:19 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by kujista, Today, 06:23 AM
            5 responses
            15 views
            0 likes
            Last Post kujista
            by kujista
             
            Started by traderqz, Today, 12:06 AM
            3 responses
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by RideMe, 04-07-2024, 04:54 PM
            5 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X