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 ScottWalsh, Today, 04:29 PM
            0 responses
            4 views
            0 likes
            Last Post ScottWalsh  
            Started by rtwave, 04-12-2024, 09:30 AM
            2 responses
            21 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by tsantospinto, 04-12-2024, 07:04 PM
            5 responses
            69 views
            0 likes
            Last Post tsantospinto  
            Started by cre8able, Today, 03:20 PM
            0 responses
            7 views
            0 likes
            Last Post cre8able  
            Started by Fran888, 02-16-2024, 10:48 AM
            3 responses
            49 views
            0 likes
            Last Post Sam2515
            by Sam2515
             
            Working...
            X