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

    Edit on 3/29/2017: I corrected the screenshot referenced on step 5.

    The log file is reporting an error when I try to reload ninjascripts using F5. I am running two independent strategies at the same time. Both strategies use AddChartIndicator to display stochastic and MACD indicators. When reloading the scripts, on occasion, the log reports the following error for the stochastic indicator:

    Indicator 'Stochastic': Error on calling 'SetState' method: Object reference not set to an instance of an object.

    The log also reports a similar error for the MACD indicator.

    I created a simplified script to demonstrate the error (actually leveraging a test script from a previous post - see attached). The error is sporadic and may occur on the third reload attempt or it may occur on the 50th. The number of attempts required is inconsistent.

    I am running: version 8.0.5.2 64-bit of the Ninjatrader platform.

    To reproduce the problem, I performed the following steps. I have also attached the screenshots associated with most of the steps.
    1. I opened a 300 tick window for the 6E 06-17 with a specific end date (see Data Series window screenshot).
    2. I added the 'DetectDrawingObject' script twice to simulate the two independent scripts I am normally running. I kept the default input values for the first and changed the stochastic values for the second (see "Strategy Window-prior to error" screenshot).
    3. After enabling both strategies, I checked the Indicator window which correctly showed the indicators added by the strategy (refer to the "Indicator Window - prior to the error" screenshot).
    4. On the third attempt at reloading the indicator, the log reported the errors described above (refer to the screenshot of the log).
    5. After the error, the Indicator window displays two new entries for the Stochastic and MACD indicators in addition to the ones previously added. The two new indicators do not appear to be associated with the 300-tick bar (refer to "Indicator Window - after error" screenshot)
    6. I next removed the two strategies from the strategy window.
    7. The chart window still retained two panes for the MACD and Stochastic indicators, but the panes were blank(refer to "Chart Window - after removing strategies" screenshot).
    8. Returning to the Indicator window, the two new indicators that were added after the error still remained but the original Stochastic and MACD indicators were automatically removed. Attempting to manually remove the remaining indicators resulted in an error stating the indicators were added by a strategy.(refer to "Indicator Window - error attempting to remove the indicator" screenshot).


    I'm not sure what is causing the issue, but any help would be appreciated.
    Attached Files
    Last edited by dp2002; 03-29-2017, 09:50 AM.

    #2
    I had the same, but haven't been able to reproduce this reliably either.

    I know this isn't very helpful, but it happened somehow related to adding, editing, starting, stopping, removing multiple strategies from Strategies tab or charts.

    Comment


      #3
      Thank you for your report. I am testing this on my end and will return when I have more information.
      Jessica P.NinjaTrader Customer Service

      Comment


        #4
        Following your steps, as well as testing with a large number of copies of your strategy with both many and no drawing objects, I was unable to see the same thing you were seeing in a pre-release copy of NinjaTrader. Please let us know if this continues into the next release so we may investigate further.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Jessica,

          I am running 8.0.5.2 which I believe is the latest release. Is this still considered a pre-release?

          Comment


            #6
            No 8.0.5.2 is the most recent release of NinjaTrader. I was able to use a more recent version than this to test on.
            Jessica P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cre8able, Today, 03:20 PM
            0 responses
            2 views
            0 likes
            Last Post cre8able  
            Started by Fran888, 02-16-2024, 10:48 AM
            3 responses
            46 views
            0 likes
            Last Post Sam2515
            by Sam2515
             
            Started by martin70, 03-24-2023, 04:58 AM
            15 responses
            114 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by The_Sec, Today, 02:29 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by jeronymite, 04-12-2024, 04:26 PM
            2 responses
            31 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X