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 judysamnt7, 03-13-2023, 09:11 AM
            4 responses
            59 views
            0 likes
            Last Post DynamicTest  
            Started by ScottWalsh, Today, 06:52 PM
            4 responses
            36 views
            0 likes
            Last Post ScottWalsh  
            Started by olisav57, Today, 07:39 PM
            0 responses
            7 views
            0 likes
            Last Post olisav57  
            Started by trilliantrader, Today, 03:01 PM
            2 responses
            21 views
            0 likes
            Last Post helpwanted  
            Started by cre8able, Today, 07:24 PM
            0 responses
            10 views
            0 likes
            Last Post cre8able  
            Working...
            X