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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    88 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    48 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    31 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    34 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    69 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X