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 Sparkyboy, Today, 10:57 AM
            0 responses
            1 view
            0 likes
            Last Post Sparkyboy  
            Started by TheMarlin801, 10-13-2020, 01:40 AM
            21 responses
            3,916 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by timmbbo, 07-05-2023, 10:21 PM
            3 responses
            152 views
            0 likes
            Last Post grayfrog  
            Started by Lumbeezl, 01-11-2022, 06:50 PM
            30 responses
            809 views
            1 like
            Last Post grayfrog  
            Started by xiinteractive, 04-09-2024, 08:08 AM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_Erick  
            Working...
            X