- ago
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.
0
651
6 Replies

Reply

Bookmark

Sort
- ago
#1
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.
0
- ago
#2
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.
0
- ago
#3
QUOTE:
if you wish to get the lowest value you may want to step from lets say -10 to -70 by 1 increments.
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.

I think by putting a sign on the increment, you're confusing the optimizer. It's not expecting any sign.
0
- ago
#4
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.
0
- ago
#5
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.
0
Cone8
 ( 23.82% )
- ago
#6
QUOTE:
AddParameter("P1", ParameterTypes.Double, -0.1, 0.5, 2.0, -0.1);
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.

Anyway, we need to guard against malformed parameters like this one, so thanks for the example!
1

Reply

Bookmark

Sort