For further clarity - I'm reasonably sure I'm not talking about IWorkspace Persistence here as I am not creating my own NTWindow, but idk...
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Saving user choices through restarts?
Collapse
X
-
Saving user choices through restarts?
What is the preferred way to save user inputs in an AddOn through restarts of NT? Specifically, I have a custom Checkbox control on chart trader in my AddOn. I'd like to be able to persist the state of the checkbox through a restart of the platform. I've seen some examples of writing data files to disk, but I don't know if that is the best approach.
For further clarity - I'm reasonably sure I'm not talking about IWorkspace Persistence here as I am not creating my own NTWindow, but idk...
Tags: None
-
Hello NickyD,
For what you described that depends on how you implemented the addon. If that is from an indicator you could use a public property and that would allow saving the users initial choice with the template/workspace. After the script is applied changing the user inputs would be bad practice to save something because that requires the user knows the value was changed so they can go save the workspace. Writing a file is likely the best option here to make a constant state, the value would just be written to file after being toggled. You could then reload the value in State.Configure. You could use any properties from the chart/indicator to make a filename unique to that script.
You are also correct, the IWorkspace Persistence is only for addons that implement the NTWindow/TabPage classes.
-
hmm... at the moment, there is no indicator involved at all. I am simply using OnWindowCreated and some other custom methods in my AddOn code. So for this, I understand writing it to disk to be the best option.
Are you saying that I could create public properties on my AddOn that would save with the template/workspace? Or are you talking about public properties for an indicator that I could then pass back/invoke the addon with? Or none of the above?that depends on how you implemented the addon. If that is from an indicator you could use a public property and that would allow saving the users initial choice with the template/workspace.
Comment
-
Hello NickyD,
The same process would apply with OnWindowCreated, you would have to collect some relevant info from the window you have and then for the toggle of the checkbox use that infor to write the file.
The comment for the indicator properties is specific to indicators, as you are not using an indicator the only option would be to save the data yourself.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
577 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 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
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment