Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error from Indicator

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

    Error from Indicator

    I'm working on a new indicator, it's open in the editor. I can see it in the NinjaScript Explorer. It was recently attached to a chart, but is no longer attached to a chart. When I open an indicator settings menu from a chart, the output prints: "Error on calling 'OnStateChange' method: Object reference not set to an instance of an object."

    I was not able to remove it from the chart because it was not available to click on in the indicator settings menu, so I closed NT and started it again. The error persists and I don't know how to get rid of it. Also the indicator is no longer visible as being able to be added to a chart from the indicator settings menu.

    What are you supposed to do when this happens?

    #2
    Hello WalterSkinner,

    The error means that an object being used was null. From the message we can see that's happening in the scripts OnStateChange override. If this happens when you open the indicator menu the problem is in either State.SetDefaults or State.Terminated.

    To figure out whats happening you would need to look at the code in the OnStatChange in the two states. You can try commenting out the custom code you added to see when the error stops happening and you can see the indicator in the list again .

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    213 views
    1 like
    Last Post PaulMohn  
    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    544 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    3 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    12 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    7 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Working...
    X