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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    96 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    23 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    34 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    37 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X