Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (rki), 405 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Optimal parameters for a basket of assets #467435
08/02/17 11:51
08/02/17 11:51
Joined: Aug 2017
Posts: 102
Spain
B
Brax Offline OP
Member
Brax  Offline OP
Member
B

Joined: Aug 2017
Posts: 102
Spain
Hi,

As far as i am concerned, Zorro finds the best parameters for every algo/asset combination.

¿Is there a way i can obtain the best ones for the whole basket or even for every algo but for the whole basket again?

My point is to have a simple system over a basket of assets, where i apply it with the same parameters for all of them. Maybe not the optimal way of trading, but i am doing some research and i´d like to test it.

Re: Optimal parameters for a basket of assets [Re: Brax] #467498
08/07/17 08:52
08/07/17 08:52
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
If the parameters are to be the same for all assets, then do not use the "loop" function for looping through assets, but a normal for() or while() loop. Optimize the parameters outside the loop.

Re: Optimal parameters for a basket of assets [Re: jcl] #467501
08/07/17 10:17
08/07/17 10:17
Joined: Aug 2017
Posts: 102
Spain
B
Brax Offline OP
Member
Brax  Offline OP
Member
B

Joined: Aug 2017
Posts: 102
Spain
Ok, thanks a lot.

Re: Optimal parameters for a basket of assets [Re: Brax] #467578
08/14/17 10:33
08/14/17 10:33
Joined: Aug 2017
Posts: 102
Spain
B
Brax Offline OP
Member
Brax  Offline OP
Member
B

Joined: Aug 2017
Posts: 102
Spain
Hi jcl,

I´ve been trying to do what you told me, but i think i am either doing something wrong or maybe it´s not possible to do with Zorro what i intended.

This is the code i´m testing.

Code:
static var opt_Filtered;
static var opt_Signal;
static var opt_Threshold;
static var opt_Stop_Cntr;
	
function tradeCounterTrend()
{
	vars Price = series(priceClose());
	vars Filtered = series(BandPass(Price,opt_Filtered,0.5));
	vars Signal = series(Fisher(Filtered,opt_Signal));
	var Threshold = opt_Threshold;
	
	Stop = opt_Stop_Cntr * ATR(10);
	Trail = 4*ATR(10);
	
	if(crossUnder(Signal,-Threshold))
		enterLong(); 
	else if(crossOver(Signal,Threshold)) 
		enterShort();
}

function run()
{
	set(LOGFILE+PARAMETERS);
	NumCores = -2;
	BarPeriod = 24*60;
	LookBack = 500;
	StartDate = 2005;
	EndDate = 2015;
	Capital = 10000;
	
	if(ReTrain) {
		UpdateDays = -1;
		SelectWFO = -1;	
		reset(FACTORS);	
	}

	// Parameters	
	opt_Filtered = optimize(30,20,40,1);
	opt_Signal = optimize(10,5,20,1);
	opt_Threshold = optimize(1,0.5,1.5,0.1);
	opt_Stop_Cntr = optimize(4,2,10,1); 
	
	int i;
	string assets[2];
	assets[0] = "EUR/USD";
	assets[1] = "USD/JPY";
	
	for(i=0;i!=2;i++){
		asset(assets[i]);
		Lots = 5;
		tradeCounterTrend();	
	}
			
	PlotWidth = 1024;
	PlotHeight1 = 400;
}



When i run this, it seems that Zorro is optimizing only for the last asset, and then it aplies those parameters for the two of them.

I suspect this, because if i do it the loop way i can see the parameters given are those for USDJPY in this case.

Probably i´m doing something wrong. My idea was to obtain a set of parameters optimized for the whole basket, that is, those that get a decent result for all the set, not just for one of them an then applying the same parameters for the rest.

It is a kind of global optimization, not one by one and then summing up all equities.

Re: Optimal parameters for a basket of assets [Re: Brax] #467596
08/15/17 17:54
08/15/17 17:54
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
I thought that was just what you wanted to do - optimizing parameters that are not for one, but common for all assets.

If not, use a loop and put the optimize calls inside. Then you get individual parameters for any asset. Parameters can be either common or individual, but obviously not both at the same time.

Re: Optimal parameters for a basket of assets [Re: jcl] #467605
08/16/17 10:25
08/16/17 10:25
Joined: Aug 2017
Posts: 102
Spain
B
Brax Offline OP
Member
Brax  Offline OP
Member
B

Joined: Aug 2017
Posts: 102
Spain
Yes, what you first told me was right. It´s only the result was not exactly what i expected.

Anyway, i think it suited my purpose.

Thanks a lot.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1