• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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
    Patrick H.NinjaTrader Customer Service

    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.
          Patrick H.NinjaTrader Customer Service

          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"
              Patrick H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sgordet, Today, 10:31 PM
              0 responses
              1 view
              0 likes
              Last Post sgordet
              by sgordet
               
              Started by Ilpropio, Today, 09:45 PM
              0 responses
              2 views
              0 likes
              Last Post Ilpropio  
              Started by Revan, Today, 05:44 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Marco  
              Started by superg3, Today, 07:57 PM
              0 responses
              3 views
              0 likes
              Last Post superg3
              by superg3
               
              Started by Longhornmark, Today, 07:06 AM
              5 responses
              35 views
              0 likes
              Last Post nkhoi
              by nkhoi
               
              Working...
              X