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
Parameters "read only"
Collapse
X
-
Originally posted by DEEPIKALI
- Likes 1
-
Sounds like you need a read-only property ... which is not the same thing as a read-only variable.
Define the variable any way you want, ie, just define it normally, or make it const.
Then make the property read-only using one of the techniques described above.
- Likes 1
Leave a comment:
-
Originally posted by soyjesus View PostHello,
I need to set a "read only" parameter in my strategy ("version" for example), so the user can view it but he can't change it. How can I declare a read only parameter?
Thnaks and regards.Code:private const string productVersion = "1.0.0.0"; [XmlIgnore()] [GridCategory("Parameters")] public string ProductVersion { get { return productVersion; } set { ; } }
- Likes 2
Leave a comment:
-
Originally posted by soyjesus View PostHello,
I need to set a "read only" parameter in my strategy ("version" for example), so the user can view it but he can't change it. How can I declare a read only parameter?
Thnaks and regards.
- Likes 1
Leave a comment:
-
Hello soyjesus,
Thanks for your post.
You can add the ReadOnly attribute to your property to accomplish this.
For example:
Code:[Description("")] [GridCategory("Parameters")] [ReadOnly(true)] public int MyInput { get { return myInput; } set { myInput = Math.Max(1, value); } }
- Likes 1
Leave a comment:
-
Parameters "read only"
Hello,
I need to set a "read only" parameter in my strategy ("version" for example), so the user can view it but he can't change it. How can I declare a read only parameter?
Thnaks and regards.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by CortexZenUSA, Today, 12:53 AM
|
0 responses
1 view
0 likes
|
Last Post
by CortexZenUSA
Today, 12:53 AM
|
||
Started by CortexZenUSA, Today, 12:46 AM
|
0 responses
1 view
0 likes
|
Last Post
by CortexZenUSA
Today, 12:46 AM
|
||
Started by usazencortex, Today, 12:43 AM
|
0 responses
5 views
0 likes
|
Last Post
by usazencortex
Today, 12:43 AM
|
||
Started by sidlercom80, 10-28-2023, 08:49 AM
|
168 responses
2,266 views
0 likes
|
Last Post
by sidlercom80
Today, 12:05 AM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
3 responses
13 views
0 likes
|
Last Post Yesterday, 11:58 PM |
Leave a comment: