Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator throws error when zooming out - why?

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

    Indicator throws error when zooming out - why?

    Hello,

    when I load the indicator zoomed in to200 bars or so, it works and displays everything properly. Once I zoom out to see around 500 bars, the drawing suddenly disappears, the indicator's window gets empty and it throws the error " 'CalculateMinMax' method on bar 1318: The calculation results in unrenderable values." So once there are too many bars in the window it exceeds the maximum value.
    Shouldn't it calculate anyways every bar? I see from the NinjaScript Output window that it is calculating every bar and that it doesn't throw an error until the last bar. But only if I zoomed out to far.
    never had this with any indicator and therefore I am pretty clueless where to start searching for the error.
    Any idea?

    Greetings
    Last edited by seykool; 01-03-2022, 06:25 AM.

    #2
    I just found that this happens depending on the size of an array that I use. If the array is short, it doesn't throw the error. If it is too long, it does.
    Last edited by seykool; 01-03-2022, 08:16 AM.

    Comment


      #3
      Hello seykool,

      Thanks for your post.

      Debugging steps would need to be taken to determine how the script is behaving. When debugging, some things to keep in mind are as follows.
      1. Identify the specific bar where the plot with unrenderable values is calculated
      2. Test to reproduce with other plots removed to find the specific plot
      3. Use prints to check how that specific plot value gets calculated. Extreme values and divide by 0's will cause the OnCalculateMinMix error.
      If that unrenderable plot value is visible, the error would be seen.

      Below is a link to a forum post that demonstrates how to use prints to understand behavior.
      https://ninjatrader.com/support/foru...121#post791121

      Let us know if we may assist further.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment


        #4
        Hi Brandon,

        thank you for the reply with the steps.
        I nailed it down to BarsRequieredToPlot was simply too small. Although I still find it strange that it works when zoomed in and doesn't when zoomed out in some ocascions.

        Greetings

        Comment


          #5
          Actually I really had extrem values because a multiplier started too early, BarsRequiredToPlot simply cut out the strong selling at first.
          Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          574 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          332 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X