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
In the above code, the int value cannot be less than 1 (one).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
the above will let you put in any value.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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
72 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
39 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment