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

Problem with MinMax Calculation which is not in my Indicator

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

    #16
    CalculateMinMax Method error

    It's Back.
    After almost a month of not seeing this error all of a sudden it has returned. At the same time, the performance of NT8 has seriously deteriorated. It is really slow, I have to wait for a minute or two to change anything, (like calling up the indicators box and loading a new indicator). I can't say for sure, but it certainly looks like the two may be related.
    The error message I get, now pretty often, certainly every time I put the indicator on a chart, is:

    Indicator BuySellDeltaPerCentMod1:Error on calling 'CalculateMinMax' method on bar XXXX: The calculation results inunrenderable values.

    Here's the weird thing. I can find no reference to this method in any part of my code. I have no idea why it is occurring because it simply isn't in there, at least not in a way that I can detect.

    Any ideas? I really like this indicator and it works extremely well in exposing order flow extremes within a bar, extremes which are generally pretty tradeable/

    Thanks

    DaveN
    Last edited by daven; 07-07-2017, 09:31 AM. Reason: re-format for better readability

    Comment


      #17
      Just wondering if anyone is going to take a look at this message today?

      Comment


        #18
        Hello daven,

        Thank you for your response.

        The calculation of the Min and Max of a panel is performed for any item that uses the Plot class.

        The items you are detailing could be related. Can you send us over the log and trace files?

        You can do this by going to the Control Center-> Help-> Mail to Platform Support.

        Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

        Please list 'ATTN: Patrick H' in the subject line and reference this thread in the body of the email.

        I look forward to assisting you further.

        Comment


          #19
          Originally posted by NinjaTrader_PatrickH View Post
          Hello daven,

          Thank you for your response.

          The calculation of the Min and Max of a panel is performed for any item that uses the Plot class.

          The items you are detailing could be related. Can you send us over the log and trace files?

          You can do this by going to the Control Center-> Help-> Mail to Platform Support.

          Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

          Please list 'ATTN: Patrick H' in the subject line and reference this thread in the body of the email.

          I look forward to assisting you further.
          Hi PatrickH,

          This seems to be a common issue people are having. When these issues are resolved (or not) in private e-mails no one on forum benefits.

          I am having the same issue just comparing two SMA in an indicator. If I use a very small period value (i.e. 3) for one of the SMAs I also get the following error in the log file:

          "Indicator ' ': Error on calling 'CalculateMinMax' method on bar 650: The calculation results in unrenderable values."

          In this case, while signal arrows will be plotted on the chart the indicator panel remains blank with no plot.

          The code compiles with no issue. Also, there is no problem with higher period values for the SMA.

          Thanks



          Comment


            #20
            Hello aligator,

            The plot would not be visible if the indicator errors out. We are getting an error that CalculateMinMax is coming up with an unrenderable value. When you place a print within a check for CurrentBar == 650 and retest, what values are being included with the SMA calculation that throws this error? You can print the most recent values used in the input series to see what these values are. For example:

            Code:
            public class TestSMA : Indicator
                {
                    private SMA SMA1;
                    protected override void OnStateChange()
                    {
                        if (State == State.SetDefaults)
                        {
                            Description                                    = @"Enter the description for your new custom Indicator here.";
                            Name                                        = "TestSMA";
                            Calculate                                    = Calculate.OnBarClose;
                        }
                        else if (State == State.DataLoaded)
                        {
                            SMA1 = SMA(Close, 10);
                        }
                    }
            
                    protected override void OnBarUpdate()
                    {
                        if (CurrentBar == 650)
                        {
                            for (int i = 0; i < 10; i++)
                                Print(Close[i]);
                            Print(SMA1[0]);
                        }
                    }
                }
            Generally, you will find that the input data will create a divide by zero scenario or similar where resulting values cannot be rendered. The CurrentBar check will also vary depending on the data set the indicator is applied against.

            Please let me know if you have any questions involving the output from the print above and how it relates to the error you are receiving.
            Last edited by NinjaTrader_Jim; 04-23-2019, 02:02 PM.
            JimNinjaTrader Customer Service

            Comment


              #21
              Originally posted by NinjaTrader_Jim View Post
              Hello aligator,

              The plot would not be visible if the indicator errors out. We are getting an error that CalculateMinMax is coming up with an unrenderable value. When you place a print within a check for CurrentBar == 650 and retest, what values are being included with the SMA calculation that throws this error? You can print the most recent values used in the input series to see what these values are. For example:

              Code:
              public class TestSMA : Indicator
              {
              private SMA SMA1;
              protected override void OnStateChange()
              {
              if (State == State.SetDefaults)
              {
              Description = @"Enter the description for your new custom Indicator here.";
              Name = "TestSMA";
              Calculate = Calculate.OnBarClose;
              }
              else if (State == State.DataLoaded)
              {
              SMA1 = SMA(Close, 10);
              }
              }
              
              protected override void OnBarUpdate()
              {
              if (CurrentBar == 650)
              {
              for (int i = 0; i < 10; i++)
              Print(Close[i]);
              Print(SMA1[0]);
              }
              }
              }
              Generally, you will find that the input data will create a divide by zero scenario or similar where resulting values cannot be rendered. The CurrentBar check will also vary depending on the data set the indicator is applied against.

              Please let me know if you have any questions involving the output from the print above and how it relates to the error you are receiving.
              Thank you Jim,

              I will do that. Thanks.

              Just for your information; I am creating an indicator based on the strategy (Posted by NT in May 2019 TASC Trader's Tips - MeanReversal strategy). I am simply removing all the startegy (trade) related information and simply making an indicator plotting Up and Dn arrows for signals. I assume if you use a value of 3 or less for the SMA1 in that strategy you may see the same error generated.

              Cheers!

              Comment


                #22
                Hello aligator,

                That strategy uses a period relative to the input parameter. When I change the Period to 3 and plot the SMA with AddChartIndicator, I do not see an issue with unrederable values. My recommendation remains to find a bar that the issue occurs, find the line throwing the error, and then to check the values that go into that calculation to see why it has come up with unrenderable values.

                If you can provide a reduced example that only contains the code related to the error and some clear steps I can take to set up and hit the issue, I could offer further input.

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

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ghoul, Today, 06:02 PM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                44 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                20 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                180 views
                0 likes
                Last Post jeronymite  
                Started by DanielSanMartin, Yesterday, 02:37 PM
                2 responses
                13 views
                0 likes
                Last Post DanielSanMartin  
                Working...
                X