Thank you -
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Unhandled Exception: Object reference not set to an instance of an object.
Collapse
X
-
Unhandled Exception: Object reference not set to an instance of an object.
I've started getting this error the last few days whenever I load my main Workspace: Unhandled Exception: Object reference not set to an instance of an object. - It seems to be accompanied by NinjaTrader not saving my strategies applied to charts - so when I restart the program, the "Strategies" tab on the main/home window for NT is blank, even though when I saved it there were several strategies applied - help finding the solution to this would be greatly appreciated - the strategy I'm running has been made through the strategy builder and I'm not aware of having made changes elsewhere in the program -
Thank you -Tags: None
-
Hello Daveman0,
I would suggest to try and isolate the problem here, the error is preventing the workspace from being loaded however the error does not say what item.
Please try doing the following:- Close all workspaces so that you are in a new empty workspace.
- Apply the strategy to a chart which has nothing else applied and then save the workspace as a new workspace.
- Close the workspace
- Re open the workspace
If that still gives the error and no other items were used besides the strategy that helps to confirm something is happening with that file, if that does not produce the error then something else in your templates/normal workspace is having an issue.
Strategies not being applied is generally just that the workspace failed to load so it may not be related to your item.
Another item to try here would be to repair the database:- Disconnect NinjaTrader from any open connections via Control Center > Connections > Disconnect
- From the NinjaTrader Control Center window select the menu Tools > Database Management
- Click on 'Repair DB'
- Press the "Repair" button
-
Looks like the database repair did the trick - thank you very much for the quick response!Originally posted by NinjaTrader_Jesse View PostHello Daveman0,
I would suggest to try and isolate the problem here, the error is preventing the workspace from being loaded however the error does not say what item.
Please try doing the following:- Close all workspaces so that you are in a new empty workspace.
- Apply the strategy to a chart which has nothing else applied and then save the workspace as a new workspace.
- Close the workspace
- Re open the workspace
If that still gives the error and no other items were used besides the strategy that helps to confirm something is happening with that file, if that does not produce the error then something else in your templates/normal workspace is having an issue.
Strategies not being applied is generally just that the workspace failed to load so it may not be related to your item.
Another item to try here would be to repair the database:- Disconnect NinjaTrader from any open connections via Control Center > Connections > Disconnect
- From the NinjaTrader Control Center window select the menu Tools > Database Management
- Click on 'Repair DB'
- Press the "Repair" button
Comment
-
In a nutshell it means.. You are trying to access an object without instantiating it.. You might need to use the "new" keyword to instantiate it first i.e create an instance of it. An Object is an instance of a Class , it is stored some where in memory. A reference is what is used to describe the pointer to the memory location where the Object resides. The message "object reference not set to an instance of an object" means that you are referring to an object the does not exist or was deleted or cleaned up. It's usually better to avoid a NullReferenceException than to handle it after it occurs. To prevent the error, objects that could be null should be tested for null before being used.
if (mClass != null)
{
// Go ahead and use mClass
mClass.property = ...
}
else
{
// Attempting to use mClass here will result in NullReferenceException
}
- Likes 3
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
54 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
72 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment