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 algospoke, Yesterday, 06:40 PM
          2 responses
          19 views
          0 likes
          Last Post algospoke  
          Started by ghoul, Today, 06:02 PM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          45 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          21 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          181 views
          0 likes
          Last Post jeronymite  
          Working...
          X