I was messing around with a new indicator trying to learn more about how DateTime worked. I did something stupid, and even though the .cs file compiled, upon refreshing NT8 crashed. Oops, I thought, I just have to comment out the offending statements and try something else. Nope! Upon relaunching NT8 promptly crashed again before everything loaded.
Searching online, there were suggestions to use the Tools --> Remove Assembly option from the main menu, but I wasn't even getting that far. I was stumped. Until I started examining the file structure a bit more closely.
In NT8 Desktop, under this path in windows are log files:
C:\Users\Username\Documents\NinjaTrader 8\log
These files end in .txt extension, so I loaded up Notepad++ and had a look. In my case, I was getting an error after the particular workspace where I had added the new indicator to a chart lived.
2023-09-04 12:01:04:761|0|4|Unhandled exception: Object reference not set to an instance of an object.
C:\Users\Username\Documents\NinjaTrader 8\workspaces
These will be named the same as your workspaces you select in the main menu, ending in .xml -- Fired up Notepad++, and searched for any instance of the indicator name that I had recently added which was causing the problem. This includes removing the ENTIRE xml block where it is mentioned. Just look at the structure and it will make sense, since in xml each tag has a start/end pair.
After saving the edited file, I launched NT8 and everything loaded fine, all my settings and indicators were present.
Support may offer a fix of deleting the NinjaTrader.Custom.dll from the C:\Users\Username\Documents\NinjaTrader 8\bin\Custom directory (It gets recreated every time you start up) but in my case that meant that I didn't have any indicators on my charts, so I didn't want to have to re-do everything.
Also note that simply deleting the offending .cs file from the C:\Users\Username\Documents\NinjaTrader 8\bin\Custom\Indicators directory didn't help, since the compile had already made other bits that NT8 was referencing.
Hope that helps someone, its a lot less destructive than the other suggestions I've seen while searching.
Cheers!
Comment