Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Object reference not set to an instance of an object

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

    Object reference not set to an instance of an object

    Hi

    I see this error from time to time and I do not know what to look for to correct it. It compiles OK but on runtime i get this message in the log saying that there was an error calling"OnBarUpdate" method for indicator xxxxxxx on bar xxxxxx. Also, the indicator does not plot on my chart.

    Attached is the indicator giving my the problem. I cleaned up the TSSupertrend a bit and added a few lines of code. I must have deleted more than I should have but there is no indication of what the problem is. If someone could point me in the right direction as to what to look for i would be grateful.

    Regards

    Sammy
    Attached Files

    #2
    Sammy, I took a look and can't seem to reproduce those issues here - ensure you're running against realtime data, since on historical data it would return out of the OnBarUpdate(). Also you want to remove the FilterSeries, as it does not seem to be used in your cleanup version.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thank you Bertrand.
      I am infact running against replay data.
      The thing is that sometimes this error appears in the strategy analyser and I still have no Idea where it is.
      Would running in debug mode help? Will it give me the line that was causing the exception?
      Sammy

      Comment


        #4
        Yes, the debugger should be able to catch it - another idea would be using standard C# try / catch - http://www.ninjatrader.com/support/f...ead.php?t=9825
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, 04-19-2024, 02:10 AM
        3 responses
        41 views
        0 likes
        Last Post gaz0001
        by gaz0001
         
        Started by Max238, Today, 01:28 AM
        2 responses
        26 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by Shansen, 08-30-2019, 10:18 PM
        25 responses
        949 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by JonesJoker, 04-22-2024, 12:23 PM
        8 responses
        42 views
        0 likes
        Last Post JonesJoker  
        Started by timko, Today, 06:45 AM
        0 responses
        7 views
        0 likes
        Last Post timko
        by timko
         
        Working...
        X