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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    72 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    42 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    110 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    190 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    172 views
    0 likes
    Last Post CarlTrading  
    Working...
    X