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

RoundToTickSize() dies with Index was outside the bounds of the array exception.

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

    RoundToTickSize() dies with Index was outside the bounds of the array exception.

    The very old exception comes again. And this is really annoying.
    This happened inside OnRender()
    Are you guys gonna to do something with your RoundToTickSize()?!
    Could you check the array size, please?!

    platformsupport@ didn't help and asked for samples to reproduce this sporadic bug
    That's why I'm posting here.
    What do you think, guys? Should Ninja fix their bugs ASAP or should to wait for samples with eyes closed?


    Trace:

    2018-07-09 19:23:56:845 ERROR: Thread: 21 Hash: 16346871 NinjaTrader.NinjaScript.Strategies.DOMPressure2 1.0.1 beta State: Realtime Exception: Index was outside the bounds of the array. Source: NinjaTrader.Core Stack: at NinjaTrader.NinjaScript.NinjaScriptBase.get_Instru ment() at MZpack.NT8.CoreIndicator.YidOVJiZtFKnKarNvtO(Objec t ) at MZpack.NT8.CoreIndicator.get___Instrument() at MZpack.NT8.CoreIndicator.RoundToTickSize(Double price) at MZpack.NT8.FootprintBar.RenderFootprint(Int32 footprint, FootprintRenderArgs e) at MZpack.NT8.FootprintBar.Render(RenderArgs e) at MZpack.FootprintBarsBase.qXY1t4eibo4drgkyJ6e(Objec t , Object ) at MZpack.FootprintBarsBase.Render(RenderArgs e) at MZpack.FootprintBaseMVC.Render(RenderArgs e) at MZpack.NT8.FootprintMVC.Render(RenderArgs e) at MZpack.NT8.mzFootprint.Render(ChartControl chartControl, ChartScale chartScale) at MZpack.NT8.MZpackStrategyBase.yJti4ZrrmyeVNAgwEyK( Object , Object , Object ) at MZpack.NT8.MZpackStrategyBase.OnRender(ChartContro l chartControl, ChartScale chartScale)

    PHP Code:
            [XmlIgnore()] [Browsable(false)] public Instrument __Instrument => strategy.Instrument;

            public 
    double RoundToTickSize(double price)
            {
                if (
    __Instrument != null && __Instrument.MasterInstrument != null)
                {
                    return 
    __Instrument.MasterInstrument.RoundToTickSize(price);
                }
                else
                    return 
    0;
            }


        public abstract class 
    CoreIndicator :
            
    IIndicatorIPlatformIndicator 
        
    {
            protected 
    MZpackStrategyBase strategy// Master strategy 
    Last edited by ren37; 07-10-2018, 02:28 AM.

    #2
    Hello ren37,

    Thanks for your post.

    My teammates and I are genuinely invested in making sure that issues that got brought up get thoroughly investigated, and an internal ticket gets formed so our QA and Development teams can address them. This process involves having a simple piece of code to reproduce and demonstrate the issue, steps involved to hit the issue, and some detail describing the cause. Without these details it is incredibly difficult to get hard-to-catch issues resolved.

    Now with that said, we are completely willing to work with you further to make sure that the issue is fully understood and we get a proper report filed. I would like to do so, but with the example provided, I do not see where you are encountering an issue. I have used Instrument.MasterInstrument.RoundToTickSize() in OnRender() many times before without encountering any issues at all.

    So we can move forward with this issue,
    • Can this be reproduced without the inheritance you are using?
    • Could you provide a simple export that can demonstrate what you are running into?


    Like I mentioned, I have not had issue with RoundToTickSize() in OnRender(). If you are hitting an issue in a certain way, I would like to understand how so we can report it further.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi

      Do you need a sample? Again? OMG.
      I can tell you the only way to fix such kind of bug: stop asking for samples, look inside your 10 lines failed RoundToTickSize() and fix the bug.
      Nice that your synthetic tests work well. But I'm afraid I can't explain to you about sporadic bugs in multi-threading apps. But you may google I think...

      PS.
      Accessing Times[][] still rises sporadic exception. See my QA-3581.

      Originally posted by NinjaTrader_Jim View Post
      Hello ren37,

      Thanks for your post.

      My teammates and I are genuinely invested in making sure that issues that got brought up get thoroughly investigated, and an internal ticket gets formed so our QA and Development teams can address them. This process involves having a simple piece of code to reproduce and demonstrate the issue, steps involved to hit the issue, and some detail describing the cause. Without these details it is incredibly difficult to get hard-to-catch issues resolved.

      Now with that said, we are completely willing to work with you further to make sure that the issue is fully understood and we get a proper report filed. I would like to do so, but with the example provided, I do not see where you are encountering an issue. I have used Instrument.MasterInstrument.RoundToTickSize() in OnRender() many times before without encountering any issues at all.

      So we can move forward with this issue,
      • Can this be reproduced without the inheritance you are using?
      • Could you provide a simple export that can demonstrate what you are running into?


      Like I mentioned, I have not had issue with RoundToTickSize() in OnRender(). If you are hitting an issue in a certain way, I would like to understand how so we can report it further.

      Comment


        #4
        Be nice ren37. It can be very hard to fix a bug if it isn't happening on a test computer. This is why the reproducible sample is required.
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          Is this a product from https://www.mzpack.pro/?
          Perhaps the error is happening in MZpack's product?
          Have you contacted their support?

          Comment


            #6
            Originally posted by bltdavid View Post
            Is this a product from https://www.mzpack.pro/?
            Perhaps the error is happening in MZpack's product?
            Have you contacted their support?
            Definitely, you are not a coder...

            Comment


              #7
              Hello ren37,

              I have sent you a message via email. Please send me a reply so we may continue correspondence off the forums and my Lead can work with us as well.

              I look forward to being of further assistance.
              JimNinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Jim View Post
                Hello ren37,

                I have sent you a message via email. Please send me a reply so we may continue correspondence off the forums and my Lead can work with us as well.

                I look forward to being of further assistance.
                Finally, I code my own RoundToTickSize() function. Built-in one doesn't work in 100% cases.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Waxavi, Today, 02:10 AM
                1 response
                16 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by Kaledus, Today, 01:29 PM
                5 responses
                13 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by Waxavi, Today, 02:00 AM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by alifarahani, Today, 09:40 AM
                5 responses
                23 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by gentlebenthebear, Today, 01:30 AM
                3 responses
                17 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X