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
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.
JesseNinjaTrader Customer Service
-
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.
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.
JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by proptradingshop, 03-21-2024, 09:50 AM
|
5 responses
25 views
0 likes
|
Last Post Today, 05:17 AM | ||
Started by MaupinFinche, Today, 05:08 AM
|
0 responses
2 views
0 likes
|
Last Post
by MaupinFinche
Today, 05:08 AM
|
||
Started by Enkidu, Yesterday, 06:40 AM
|
9 responses
35 views
0 likes
|
Last Post
by Enkidu
Yesterday, 01:11 PM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
12 responses
307 views
0 likes
|
Last Post
by z.franck
Today, 04:29 AM
|
||
Started by AgriTrdr, 07-16-2023, 12:54 PM
|
32 responses
268 views
0 likes
|
Last Post
by f.saeidi
Yesterday, 06:49 AM
|
Comment