When doing any variation on that, NinjaTrader appears to ignore the fact that its a double and just goes straight to "1". Any way around this?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Problem with user variable that is a Double
Collapse
X
-
Problem with user variable that is a Double
I am working on optimizing an automated strategy that has a double variable that it's supposed to test. -.0004;.0004;.0001
When doing any variation on that, NinjaTrader appears to ignore the fact that its a double and just goes straight to "1". Any way around this?Tags: None
-
Hello,
Thank you for your post and welcome to our forums!
From your Properties section of your code, what do you have the Max/Min function set to? Is this at 1 or do you have it as low as 0.0001 to accommodate the variables you wish to optimize on?
For example if it was set such as the following, the lowest value it would take would be a value of 1
Code:set { myVariable = Math.Max(1, value); }MatthewNinjaTrader Product Management
-
I don't see an option in the User Defined Input screen for a "maximum" though I did alter the "minimum" to -.004, but it still doesn't step properly in optimization. It appears to jump to integers and or the max. ie: -.004;.004;.001 does -.004, 0, and .004 and nothing in between
Comment
-
From the User Defined Input Screen, you would need to set the minimum to at least 0.0001. Or you can just set the minimum to 0 and that will allow any double input.
Regarding the results you're seeing, when you say
Do you mean you have it set to Optimization parameters set to Min. Value and Max value of 0.004 and the increment to .001?.004;.004;.001 does -.004, 0, and .004 and nothing in between
That would only give you results from 0.004.
What you want to do is define a range between the min and max value, and then say how you want it to increment. For example you could set the Min. value to 0.001, and the Max to 0.004 and then increment to 0.001.
This would then run on 0.001, 0.002, 0.003 and end on 0.004.MatthewNinjaTrader Product Management
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
368 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 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
571 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment