When I define one of parameters like this:
AddParameter("P1", ParameterTypes.Double, -0.1, 0.5, 2.0, -0.1);
the optimization does not seem to work, but when I reverse min, max values and define it like this:
AddParameter("P1", ParameterTypes.Double, -0.1, -2.0, 0.5, 0.1);
Everything works. QuickRef documentation does not seem to require that increment should always be positive, so it could be either a code issue or documentation issue.
AddParameter("P1", ParameterTypes.Double, -0.1, 0.5, 2.0, -0.1);
the optimization does not seem to work, but when I reverse min, max values and define it like this:
AddParameter("P1", ParameterTypes.Double, -0.1, -2.0, 0.5, 0.1);
Everything works. QuickRef documentation does not seem to require that increment should always be positive, so it could be either a code issue or documentation issue.
Rename
Why would anyone want a negative increment value in the first place?
But I agree, the optimizer should throw an error if a negative increment value is specified so the user can correct that.
But I agree, the optimizer should throw an error if a negative increment value is specified so the user can correct that.
When you are using certain indicators (CMO) for example the range of the indicator is both positive and negative, so if you wish to get the lowest value you may want to step from lets say -10 to -70 by 1 increments.
QUOTE:That's fine. However, your increment is still 1.0, not -1. It's the job of the optimizer to control the direction, not the sign on the increment.
if you wish to get the lowest value you may want to step from lets say -10 to -70 by 1 increments.
I think by putting a sign on the increment, you're confusing the optimizer. It's not expecting any sign.
It might be a documentation issue, rather than a coding issue.
I was looking at it from the perspective of nature of the parameter. If it was easier for me to think about parameter decreasing from higher values to lower values, I would feel natural to set increment negative - programming languages and other tools I've seen generally have no problems with it.
I was looking at it from the perspective of nature of the parameter. If it was easier for me to think about parameter decreasing from higher values to lower values, I would feel natural to set increment negative - programming languages and other tools I've seen generally have no problems with it.
I don't see this as a bug and agree with superticker. Once there was a real bug with negative increment freezing the program but that's long gone. Wealth-Lab probably could treat negative increments as positive internally but there may be aspects I'm overlooking.
So it seems that topic starter has the solution: simply use positive increments.
So it seems that topic starter has the solution: simply use positive increments.
QUOTE:Also note that in this example, the default is outside the start and stop values, although I assume you meant to put -2.0 there.
AddParameter("P1", ParameterTypes.Double, -0.1, 0.5, 2.0, -0.1);
Anyway, we need to guard against malformed parameters like this one, so thanks for the example!
Your Response
Post
Edit Post
Login is required