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.
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.