• 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

Market Analyzer - Error on calling OnBarUpdate

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

    Market Analyzer - Error on calling OnBarUpdate

    Hi,

    I am having an issues utilizing Market Analyzer with my indicator. The indicator works perfect while on a chart and the Output is clean.

    I added a Series<double> to use so I could access numbers in the Market Analyzer but when I reload the script in the MA I randomly get these errors.

    Indicator 'RokzAPA on 60 Minute data': Error on calling 'OnBarUpdate' method on bar 1753: Object reference not set to an instance of an object.

    It does a lot of drawing on the chart, and all Series are Initialized in the State.Configure. Is there a common issue or something basic I may have missed?

    Thanks,
    Rokz

    #2
    Originally posted by IIIRokzIII View Post
    Hi,

    I am having an issues utilizing Market Analyzer with my indicator. The indicator works perfect while on a chart and the Output is clean.

    I added a Series<double> to use so I could access numbers in the Market Analyzer but when I reload the script in the MA I randomly get these errors.

    Indicator 'RokzAPA on 60 Minute data': Error on calling 'OnBarUpdate' method on bar 1753: Object reference not set to an instance of an object.

    It does a lot of drawing on the chart, and all Series are Initialized in the State.Configure. Is there a common issue or something basic I may have missed?

    Thanks,
    Rokz
    This is in the wrong forum.

    There is a bug in NT8 B12. I have it too in Market Replay.

    The NT8 forums are at the bottom on the main forum list, and more specifically here:

    http://ninjatrader.com/support/forum...splay.php?f=57

    The issues and bug reports is where to report this:

    http://ninjatrader.com/support/forum...splay.php?f=60
    Last edited by sledge; 08-04-2016, 06:17 PM.

    Comment


      #3
      Thanks for the reply, so I can stop thinking its my fault and re-arranging my code.

      Maybe they should tag the forums better.

      Comment


        #4
        I'm pretty sure in previous Beta's, the indicator would also die on the chart along with the strategy.

        Do you have more than 1 plot? I am using 2 plots.

        Comment


          #5
          No plots, just using the Series<double> to get values. Using about 20+ Series though.

          Through Market Analyzer I am only trying to utilize one of them.

          Comment


            #6
            Originally posted by IIIRokzIII View Post
            No plots, just using the Series<double> to get values. Using about 20+ Series though.

            Through Market Analyzer I am only trying to utilize one of them.
            Hmmm, I do have 3 List of ints

            public LIst<int> xyz = new List<int>();

            and 2 of doubles

            public List<double> abc = new List<double>();


            This looks worth pursuing in a test case. I'll try to code something up this weekend that causes this.

            I only see issue though when starting a new contract (I run replay over ES 03-14, ES 06-14, ES 09-14, ES 12-14 )... and it appears to happen in 2nd or 3rd or 4th contract.. never the first.

            And with your analyzer runs - being over and over - it might be the issue.

            Comment


              #7
              Now that you say that, my output shows my Prints properly. I have one Print on State.Configure second on State.DataLoaded then the remaining Prints are after all the patterns are found on each Instrument. It does this when I refresh the Market Analyzer with the indicator running on one column.

              There seems to be no issue if there is a return number of 0.

              In the below pic,
              INITIALIZE is in State.Configure
              STARTUP is in State.DataLoaded
              (I just use these to remember how they were in NT7)
              There are 10 of each, proving its attempted all 10 Instruments in my Market A. It seems to find some that have a return of 0. Then errors randomly or on ones that might try return a value.



              Sorry about pic size, I guess thats what happen when you screenshot on a 4k monitor... Tried re-sizing, doesn't do anything, bit like NT8...
              Last edited by IIIRokzIII; 08-05-2016, 12:56 AM.

              Comment


                #8
                Hello,

                It appears you are getting an object reference not set to an instance of an object error, this is a fairly specific error.

                This would indicate that some of the logic used in the scripts OnBarUpdate is having an error trying to use an object that is null.

                Without seeing the syntax or a sample that shows what object is causing the error in the logic, it would be impossible to say what the problem is.

                To locate the problem, you could use debugging or comment out code and re run the same scenario that causes the errors. If the errors still happen, continue to comment out more code until you see the errors are not happening. You could then work forwards to find the specific region of code that controls the error to review it in more detail.


                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Hey Jesse,

                  Cheers for reply. I realize what the error is. But, can you explain why it only appears in the Market Analyzer? When I run this indicator on a chart I have ZERO issues with null objects. I can return the correct number in Draw.Text on my charts using the exact Series<double> I am trying to access with the Market Analyzer.

                  That picture I posted with the errors. When I show Output while running the indicator on a chart, all Outputs are correct.

                  Thanks,
                  Rokz

                  Comment


                    #10
                    Hello,

                    Without seeing the syntax used that is failing, I really could only guess.

                    One common item would be using anything Chart specific like ChartControl, ChartPanel etc.. The MA is not a chart so these items fail if you do not check for null I.E:

                    Code:
                    if(ChartControl != null)

                    Again if you have any sort of sample that would help explain what is happening.

                    Also because this is the beta, I will move this thread into the correct NT8 forum. In the case of the beta we generally ask for syntax examples because if you are doing something standard that is not working correctly we would want to know the syntax you used in order to address what is happening.


                    I look forward to being of further assistance.
                    JesseNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Tyler7498, Today, 07:34 PM
                    0 responses
                    4 views
                    0 likes
                    Last Post Tyler7498  
                    Started by Woomera, Today, 07:24 PM
                    1 response
                    4 views
                    0 likes
                    Last Post NinjaTrader_ChrisL  
                    Started by Newtrader101, Today, 12:31 PM
                    2 responses
                    13 views
                    0 likes
                    Last Post Newtrader101  
                    Started by kweiss, Today, 06:42 PM
                    0 responses
                    2 views
                    0 likes
                    Last Post kweiss
                    by kweiss
                     
                    Started by Newtrader101, Today, 06:31 PM
                    0 responses
                    4 views
                    0 likes
                    Last Post Newtrader101  
                    Working...
                    X