Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on calling 'OnBarUpdate' method

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

    Error on calling 'OnBarUpdate' method

    Hi,

    I get the following:

    **NT** Error on calling 'OnBarUpdate' method for strategy 'Abcd/3083268d6bc444d6affefde48d92234e': Object reference not set to an instance of an object.

    Nothing shocking there except the entire body of the OnBarUpdate method is in a try/catch. This would seem to indicate the error is not within my code as this error message is not coming from my catch.

    Any thoughts/suggestions will be appreciated.

    Best Regards,
    Scott

    #2
    Scott,

    Could you possibly show more of your code here?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Adam,

      All it would show is the override to OnBarUpdate with try...catch. All of my code is within the try catch and the message is not coming from the catch. Even if a method, indicator, etc. were called from OnBarUpdate and that method produced an error, the try catch would catch the error (I have a Print statement there).

      Comment


        #4
        Scott,

        Without code to look at I am not really able to assist further. I have no idea why you are getting this error message without seeing the code, especially since we would need to also check the Initialize() method and your variable declarations to ensure that you are initializing them properly.

        This error message means that there is some object not getting initialized before the code is trying to access it.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Adam,

          I understand, I posted it more as information for others who might do a search on this than anything. I have been a professional programmer for a very long time and have worked with NinjaTrader for years so I am clear on what the message is.

          The issue is very simple, I have literally every line of code within OnBarUpdate inside a try/catch and that is not where the error is coming from or the catch would, well, catch it.

          I appreciate your input; thanks for your time on this. One thing that can be frustrating is when something like this happens and you don't know others have had the same problem.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          2 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          6 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Working...
          X