Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

My indicators sometimes disappearing

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

    My indicators sometimes disappearing

    Hi guys

    I've had some strange things happening today!

    I've had situations where one of my indicators appears on one chart but not another.

    Then, on a minute-based chart, I initially loaded two of my own indicators, call them, A and B. That worked. Then I changed the chart to range bars (which I frequently do without problem), and A remained there but B disappeared. then, on the same chart, B would work but A wouldn't. (A and B are similar but not identical.)

    I uninstalled then reinstalled NT but the problem is as it was before.

    In 'Log', there are messages in yellow like:

    Error on calling OneBarUpdate method for indicator x on bar 50: You are accessing an index with a value that is invalid since its out of range...
    But there are errors for indicators that have since worked and I haven't tweaked in any way before they appeared or reappeared.

    Any advice on this would be greatly appreciated.

    #2
    Hello,

    Were these indicators you developed, or were they developed by a 3rd party?

    If you increase the "days to load" on the charts where they are not working, can you get them to calculate?

    If these were developed by you, can you clarify if they are multi-series scripts?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks very much for getting back to me so promptly, Matthew.

      1) These are indicators I've developed myself, which I've had for a few weeks and never experienced this before.

      2) There were certainly enough days on the chart, as I usually load a minimum of 50. I usually use range bars, such as 15R in EUR/USD cash. On both the these indicators I have:

      Code:
      private int period = 50;
      
      ...
      
      if(CurrentBar < Period)
                  
                  {return;}
      and there are many, many more than 50 bars on the chart.

      3) No, these are not multi-series scripts.

      I look forward to hearing from you again.

      Comment


        #4
        I'd suggest adding Try-Catch blocks to your script and replicating the error. This should help you isolate to the exact block of code that is causing the error. If you're unsure what that segment is causing it, please let us know and we'd be happy to help you figure that out.

        Please see the following reference sample on how to use these debugging resource:

        http://www.ninjatrader.com/support/f...ead.php?t=9825
        MatthewNinjaTrader Product Management

        Comment


          #5
          Thanks again, Matthew. This is my first opportunity to get back to you on this. It's extremely helpful to know about Try-Catch blocks.

          May I just recap what the situation was and is still (pls see the error messages mentioned in my first post.):

          I have several indicators which have all compiled and worked perfectly until very recently. The coding was not changed in any way before the problem started.

          What happens is sometimes they appear and sometimes they don't! My point is this: if they are capable of appearing on charts at any time, it must surely mean that they have been coded correctly and there can't be issues such as: not enough bars, etc.

          What I didn't mention before is that they all have something in common: they all use the MRO method (for the less experienced: this is the Most Recent Occurrence Method [very useful], the coding of which must involve loops.)

          I think my NT installation must be defective in some way. I did do an uninstall/reinstall since the problem started, but it changed nothing as far as this issue started.

          When you do an uninstall/reinstall, all the charts come up as before, which means that all the data must be kept on the hard disk somewhere. Is there a way of doing a complete reinstall (after doing a backup, obviously) so that Windows completely 'forgets' the previous installation?

          You see, I don't think there can be a problem with the coding of these indicators (that I've developed myself), as I've said, otherwise these indicators would never show. Or am I wrong?

          Or would there be another way of addressing this problem?

          Any suggestions will be greatly appreciated!

          Comment


            #6
            I personally do not feel that a reinstall is going to have any effect here. I understand your indicators worked for a few weeks, but there is a scenario you are facing now that has caused this and it sounds like it only happens with your indicators. I don't have enough information about your indicators to give you any very specific advice, but you should be able to isolate through the debug process, which is a natural step of any development process. I just don't see what would break in NinjaTrader where this specific issue would crop out just for you and your indicators out of nowhere.

            With that said, you're completely free to try a complete wipe of NinjaTrader and test again.

            Please follow the steps listed below to completely uninstall and reinstall NinjaTrader:

            Close all running applications.

            Then from the Start menu select --> Control Panel --> Add and Remove Programs.

            From Add and Remove Programs select NinjaTrader 7 and click Remove.

            Then manually delete the folder "NinjaTrader 7" located under Start --> My Documents.

            Delete any NinjaTrader installation files. This can be done by going to Start --> My Computer --> Search button --> search for (NinjaTrader*) --> select Local C Disk and then press search.

            Then you will need to clear your internet browser cache and history. You will clear this from within your internet browser (with IE, Tools-->Options, delete cookies and files, clear history).

            Reboot your machine.

            Once these steps are completed, download NT7 from the link below:
            http://www.ninjatrader.com/download-registration

            Please let us know if you are able to get up and running after the reinstall.
            MatthewNinjaTrader Product Management

            Comment


              #7
              Originally posted by arbuthnot View Post
              Thanks again, Matthew. This is my first opportunity to get back to you on this. It's extremely helpful to know about Try-Catch blocks.

              May I just recap what the situation was and is still (pls see the error messages mentioned in my first post.):

              I have several indicators which have all compiled and worked perfectly until very recently. The coding was not changed in any way before the problem started.

              What happens is sometimes they appear and sometimes they don't! My point is this: if they are capable of appearing on charts at any time, it must surely mean that they have been coded correctly and there can't be issues such as: not enough bars, etc.

              What I didn't mention before is that they all have something in common: they all use the MRO method (for the less experienced: this is the Most Recent Occurrence Method [very useful], the coding of which must involve loops.)

              I think my NT installation must be defective in some way. I did do an uninstall/reinstall since the problem started, but it changed nothing as far as this issue started.

              When you do an uninstall/reinstall, all the charts come up as before, which means that all the data must be kept on the hard disk somewhere. Is there a way of doing a complete reinstall (after doing a backup, obviously) so that Windows completely 'forgets' the previous installation?

              You see, I don't think there can be a problem with the coding of these indicators (that I've developed myself), as I've said, otherwise these indicators would never show. Or am I wrong?

              Or would there be another way of addressing this problem?

              Any suggestions will be greatly appreciated!
              Have you checked your log for any error records? It sounds as if your indicator is blowing up from some calculation exception, which is why it only fails sometimes, not always. The most usual culprit seems to often be an untrapped division by zero.

              Comment


                #8
                Thanks as always, Matthew, for the superb information.

                Just as it's a good idea, every couple of years, to reinstall Windows (the best way of getting rid of all that 'junk'!), I'm wondering whether a complete reinstall of NT might not be a bad idea every year or so provided of course you're 100% backed up, especially if there do appear to be some glitches. (These are just my own thoughts.)

                As and when I do this, I'll certainly report back to this thread.

                Comment


                  #9
                  Thanks very much, koganam, you may well have put your finger on it.

                  There could just be a glitch (though Matthew doubts this) in which case I should do a complete reinstall (see my previous post) or the indicator is indeed 'blowing up' (a great way of putting it) as you suggest.

                  This is the type of error message I was getting:

                  Error on calling OneBarUpdate method for indicator x on bar 50: You are accessing an index with a value that is invalid since its out of range...
                  As I've said, all three of these indicators use the MRO method, which may be a hint. I think the 'bar 50' could be at the exact point where the calculations start (after the CurrentBar...return). I'll definitely look into this.

                  Another approach, given they have all worked properly previously - and sometimes now - could be to copy the code to a totally fresh indicator (not one simply 'saved as') and then delete the original. This might be the answer...

                  Much obliged as ever.

                  Comment


                    #10
                    Originally posted by arbuthnot View Post
                    Error on calling OneBarUpdate method for indicator x on bar 50: You are accessing an index with a value that is invalid since its out of range...
                    Well nigh almost always a "division by zero" error.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by peregrine, Today, 05:49 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post peregrine  
                    Started by JamesBond, Today, 04:22 PM
                    0 responses
                    10 views
                    0 likes
                    Last Post JamesBond  
                    Started by Parmenides48, Today, 03:29 PM
                    0 responses
                    20 views
                    0 likes
                    Last Post Parmenides48  
                    Started by ezrollin, Today, 03:09 PM
                    1 response
                    13 views
                    0 likes
                    Last Post ezrollin  
                    Started by JamesBond, Today, 01:38 PM
                    2 responses
                    24 views
                    0 likes
                    Last Post JamesBond  
                    Working...
                    X