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

CalculateMinMax crash

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

    CalculateMinMax crash

    I have a customer who gets random crashes on Ninja 8. This was one of the crashes. I don't know if it's my code causing this particular crash, or something else. But I just wanted to make sure there is nothing else I can put in my code to protect against a crash like this.

    I'm assuming CalculateMinMax is for display purposes only, and I don't actually have to check whether I'm plotting outside of the min/max. I don't think I am, but I'm not checking and I'm assuming it's unrelated.

    Thanks


    I'm using an override for CalculateMinMax

    Code:
    		public override void OnCalculateMinMax()
    		{
    			MinValue = 0;
    			MaxValue = 7;
    		}

    This is the crash

    Code:
    2017-05-24 04:26:30:816 Gui.Chart.ChartPanel.OnRender: System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at NinjaTrader.NinjaScript.NinjaScriptBase.get_Instrument()
       at NinjaTrader.Gui.Chart.ChartScale.CalculateMinMax()
       at NinjaTrader.Gui.Chart.ChartPanel.CalculateMinMax()
       at NinjaTrader.Gui.Chart.Direct2DForm.RenderInit()

    #2
    Hello bubblegum,

    May I have an export of slimmed down script that is able to reproduce this behavior?

    Please only include the bare minimum code that is absolutely necessary to reproduce.

    To export a NinjaTrader 8 NinjaScript do the following:
    1. Click Tools -> Export -> NinjaScript...
    2. Click the 'add' link -> check the box(es) for the script(s) you want to include
    3. Click the 'Export' button
    4. Enter a unique name for the file in the value for 'File name:'
    5. Choose a save location -> click Save
    6. Click OK to clear the export location message

    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>


    Below is a link to the help guide on Exporting NinjaScripts.


    Please attach an export of the reduced version to your next post.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Is there any way to see the solutions to these issues? I'm guessing many of us have similar problems and it would be beneficial to all if these threads went from problem to solution. As it stands there are multiple threads with similar CalculateMinMax method issues and none of them have a solution.

      Can someone tell us the solution to bubblegum's problem?

      Thanks.

      Comment


        #4
        Hello imalil,

        To do so, I will need to see the code generating the error.

        Currently, I am not able to reproduce this error when setting the MaxValue and MinValue in a test indicator.

        Are you able to reproduce using this test script?

        Are you on the latest version of NinjaTrader (8.0.7.1)?
        Attached Files
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I was simply wondering if there was a solution. If there's no answer, then never mind.

          Is there a solution to any of the other CalculateMinMax threads on this forum? Just wondering.

          Comment


            #6
            Hello imalil,

            There was a specific issue (QA-2025) where adding multiple series and calling the RSI was causing an error and this was corrected.

            Can you provide a link to a thread where an inquiry about OnCalculateMinMax has not been resolved?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              This is the only other one:

              Comment


                #8
                Hello imalil,

                This thread is in the NinjaTrader 7 section of the forums.

                I am happy to look further into what happened with this user.

                May I confirm that you are inquiring about NinjaTrader 7 and you are not inquiring about NinjaTrader 8?

                (If there is an issue this may not be the same between the two platforms)
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  I thought it was NT8. Nevermind.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by techgetgame, Yesterday, 11:42 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post techgetgame  
                  Started by sephichapdson, Yesterday, 11:36 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post sephichapdson  
                  Started by bortz, 11-06-2023, 08:04 AM
                  47 responses
                  1,613 views
                  0 likes
                  Last Post aligator  
                  Started by jaybedreamin, Yesterday, 05:56 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  20 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Working...
                  X