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

OnBarUpdate or Plot Method Error

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

    OnBarUpdate or Plot Method Error

    I have an indicator that plots 10 different lines. When I exit from the indicator parameters window, I get an error "Please check the OnBarUpdate or the Plot method. Index was outside the bounds of the array." And the levels are not drawn on the chart.

    However, if I press F5 on the chart, all the levels draw as they should and there are no errors.

    I have all my code wrapped in try-catch blocks and those are not catching any errors.

    Any ideas? I have been using my indicator for months now and never got this error before. It seems to have just started happening in the last couple of days.

    Thanks!

    #2
    Hello nedrob519,

    Thank you for your note.

    This would point to a value being set or accessed outside of the possible range. Are you ensuring you have enough bars to calculate the values?

    Please review the information at the following link: http://www.ninjatrader.com/support/f...ead.php?t=3170

    Comment


      #3
      Yes, I check for currentbars: if (CurrentBars[0] < 20 || CurrentBars[1] < 20) return;

      As I said, if I press F5 to refresh the chart, everything is perfect and there are no errors.

      The only time I get the error is when I exit the Indicator's Parameter window. The error is in the log and the plots don't plot. And, none of my try catch blocks are executed when exiting the parameter window also.

      I would think that if there really was this error, pressing F5 to refresh the chart would not work.

      So there must be a different execution path that is at work, right?

      Comment


        #4
        Here is the Property Get is am using.

        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries High
        {
        get { return Values[1]; }
        }

        Anything here?

        Comment


          #5
          Hello nedrob519,
          Originally posted by nedrob519 View Post
          I would think that if there really was this error, pressing F5 to refresh the chart would not work.

          So there must be a different execution path that is at work, right?
          That would not be the case. Compiling does not run the code over a data set.

          Comment


            #6
            Not F5 in the compiler. You misunderstood.

            If you press F5 on the CHART, it reloads the indicators. That works 100% of the time.

            So - it doesn't work when closing the indicator's parameter window. But it DOES work when pressing F5 on the CHART to re-load the indicator.

            It should work in both places or not at all unless there is something different about those 2 execution paths.

            Thanks,

            Comment


              #7
              Both should load in the same manner. Please send me your log and trace files for today so that I may look into what occurred. You can do this by going to the Control Center-> Help-> Mail to Platform Support. Please reference this thread in the subject line of the e-mail: "http://www.ninjatrader.com/support/forum/showthread.php?t=71431"

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by nandhumca, Yesterday, 03:41 PM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by The_Sec, Yesterday, 03:37 PM
              1 response
              11 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by vecnopus, Today, 06:15 AM
              0 responses
              1 view
              0 likes
              Last Post vecnopus  
              Started by Aviram Y, Today, 05:29 AM
              0 responses
              5 views
              0 likes
              Last Post Aviram Y  
              Started by quantismo, 04-17-2024, 05:13 PM
              3 responses
              27 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X