I found a possible workaround.
I am using a wrapper around the optimize() call that writes the parameter names, in call order, to a separate file:
typedef struct ZINPUT_PARAM {
var Value;
var Min;
var Max;
var Step;
bool OrderWritten;
} ZINPUT_PARAM;
...
static var resolveZInputParam(string Name, ZINPUT_PARAM* Param)
{
if (!Param->OrderWritten) {
file_append(OptimizeOrderFile, strf("%s\n", Name), 0);
Param->OrderWritten = true;
}
return optimize(
Name,
Param->Value,
Param->Min,
Param->Max,
Param->Step,
0
);
}
So when I get a .par file like this:
I also get a corresponding .order file like this:
Param2
TrendPeriod
OtherSuperSecretParam
This lets me map the values in the .par file back to their corresponding parameters.
Is there a native Zorro function or mechanism for retrieving the order of the optimize() calls dynamically?