I have a parameter in strategy that is a signed integer (int) , but then in strategy analyzer, i can't enter negative value in the optimize box, such as -4. Why is this? Any workaround?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
int data can't be specified as negative
Collapse
X
-
Hello ssg10,
I am glad to help you.
The integer(int) has a Minimum value assigned to it, like the int cannot be less than 1 etc.
so a code will look like this
Code:[Description("")] [GridCategory("Parameters")] public int MyInput0 { get { return myInput0; } set { myInput0 = [COLOR=Red]Math.Max(1, value)[/COLOR]; } }
To change the same you just remove the Math.Max part. So a modified code of the above will be like
Code:[Description("")] [GridCategory("Parameters")] public int MyInput0 { get { return myInput0; } set { myInput0 = [B][COLOR=Blue]value[/COLOR][/B]; } }
If you have coded the strategy via the wizard, then please edit the same. In the User Defined Inputs box, assign a value like -9999 (mind the minus) in the Min field of the said int parameter.
Please let me know if I can be of any further help.
Regards,
Joydeep.JoydeepNinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bortz, 11-06-2023, 08:04 AM
|
47 responses
1,604 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
8 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
4 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
13 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment