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 sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,262 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,429 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, 04-16-2024, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            41 views
            0 likes
            Last Post jeronymite  
            Working...
            X