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
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
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
.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 lollers, Today, 03:26 AM
|
0 responses
5 views
0 likes
|
Last Post
by lollers
Today, 03:26 AM
|
||
Started by aliyahany, Today, 03:16 AM
|
0 responses
1 view
0 likes
|
Last Post
by aliyahany
Today, 03:16 AM
|
||
Started by mariajvillarrealr, Today, 02:57 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 02:57 AM | ||
Started by marcus2300, Yesterday, 10:21 AM
|
6 responses
20 views
0 likes
|
Last Post
by marcus2300
Today, 01:53 AM
|
||
Started by skorpn, Today, 01:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by skorpn
Today, 01:28 AM
|
Comment