Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Add-on Serialization
Collapse
X
-
Add-on Serialization
I'm having a bit of trouble getting my add-on to serialize as expected. I have attached a sample to show the issue. The serialization seems to work if I simply close and reopen a workspace with the window, but if I restart NT the default settings are restored. Any ideas how to maintain the settings through a restart?
Tags: None
-
Hello,
To save specific values you would need to use the IWorkspacePersistance Save and Restore methods. There is a sample that demonstrates adding custom values to the workspace here: https://ninjatrader.com/support/foru...588#post822588
The take away is that you need to explicitly save anything which is not part of the base class being saved.
The values inside your Addon derived class won't be saved but you can save anything within your TabPage or NTWindow class which is where the persistence is used.
In the sample that you provided the base addon class should really only be used for adding a menu item and opening the window based on the menu click. The public properties you made could be removed and your initialize method in the view model you made can be removed. Any properties/logic your addon uses should go directly in the NTWindow derived class or if you use tabs then TabPage derived class. To set the values in the view model class you would need to do that from the Restore method that the NTWindow uses to load from the workspace data.
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment