Gamestudio Links
Zorro Links
Newest Posts
[MED] Import from FBX (2010) missing!!!
by USER0328. 09/03/26 18:03
Purchase A8 full licence version
by ukgamer. 08/30/26 14:27
ZorroGPT
by TipmyPip. 08/29/26 06:56
Retrieve optimize() variables order (edited)
by NorbertSz. 08/25/26 13:24
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (Quad), 1,471 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19230 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Retrieve optimize() variables order (edited) #489608
08/25/26 13:07
08/25/26 13:07
Joined: Jan 2022
Posts: 81
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 81
Budapest
Hello,

(Sorry it was my mistake - I initially thought that the .par files did not contain parameters from optimize(X, 0, 0, 0), but they actually do.)

I still have the following problem:

I am using a custom evaluation/orchestration setup that runs many optimization jobs with different configurations and custom names. As a result, I end up with many .par files, and from the .par file alone I cannot reliably determine which parameter corresponds to which optimize() call.

The order of parameters in .par file is not sufficient for me, because the orchestration can inject different optimization configurations, and the injection order does not necessarily match the order of the optimize() calls in the script.

So the injector does not know the order of the optimize calls in the compiled startegy file.
I would be fine with writing this information from the script itself at the end of optimization, something like

Code
if(is(ENDOFALLOPTIMIZE) && Train){
   printf(... finalValue(variable) ...);
}


So what would be the recommended way to retrieve/save the mapping between the parameters in the .par file and their corresponding optimize() calls?

(I could also parse the generated HTML report, since it contains the variable names and values. However, with 1000 jobs, this would open 1000 browser windows. I would like to run the optimizations with Zorro S in headless mode, using only command-line commands, without opening any browser windows.)

Thank you!

Last edited by NorbertSz; 08/25/26 21:33.
Re: Retrieve fixed optimize() variables and their values [Re: NorbertSz] #489609
08/25/26 13:24
08/25/26 13:24
Joined: Jan 2022
Posts: 81
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 81
Budapest
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:

Code

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:

Code
EUR/USD,20,48,40,1.870


I also get a corresponding .order file like this:

Code
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?

Last edited by NorbertSz; 08/25/26 22:08.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1