In finance the goal is normally predicting the future price direction or trade result. I suppose that's also the intention of your script.
Exactly, that's what i try. Maybe we understand each other wrong, but I'm talking about the method Objective = 0, which causes every positive trade to count as a signal. I do not understand what an ML-Algo should / can learn if we
open randomly a trade on each bar and then use the results as a learning guide -> because in neural.train() in R you're doing this:
Y <- ifelse(Y>0,1,0)So every Trade with profit is learned as GOOD. No matter where in the chart it starts, no matter how big or small it was, what's "the underlying rule / the strategy / the edge" of signals generated in that way? What is the trade based on? Sorry that I ask so much, that's because I would like to understand the approach.
But I am currently on a very different problem
. This thread was actually about using RULES | PARAMETERS with asset() and algo() in loops(). We have already clarified that this is not possible, which is a pity. The solution was using "custom for loops" and not the loop() function from Zorro.
string myALGO[2];
int algoList() {
myALGO[0] = "W4T0";
myALGO[1] = "W4T1";
return(2);
}
function W4T() {
TimeFrame = 1;
var op1 = optimize(100,100,200,100);
var op2 = 3;// optimize(1,1,2,1);
vars dat = series(price());
vars trd = series(LowPass(dat,op1));
vars mmi = series(MMI(dat,300));
vars smo = series(LowPass(mmi,300));
Stop = op2 * ATR(100);
Trail = 0;
if(strstr(Algo,"W4T0")) {
if(valley(trd)) enterLong(); else
if(peak(trd)) enterShort();
} else if(strstr(Algo,"W4T1")) {
if(falling(smo) && valley(trd)) enterLong(); else
if(falling(smo) && peak(trd)) enterShort();
}
}
function run() {
set(COMMONSTART|PARAMETERS|OPENEND|LOGFILE);
StartDate = 2016;
EndDate = 2017;
BarPeriod = 60;
LookBack = 500;
DataSplit = 70;
NumWFOCycles = 5;
PlotWidth = 3000;
PlotHeight1 = 666;
Verbose = 3; // default 1
int asc = assetList("AssetsFix.csv"); // please edit
int alc = algoList();
int i = 0;
int j = 0;
for(i=0;i<2;i++) { // test only scan 0 & 1
asset(Assets[i]);
for(j=0;j<alc;j++) {
algo(myALGO[j]);
Script = strf("%s%s",Asset,Algo);
if(is(INITRUN)) watch("#INITRUN @ Bar",Bar,Asset,Algo,Script);
if(strstr(Algo,"W4T")) W4T();
}
}
}
I expected Zorro to produce single .par files for each Asset / Algo / WFOCycle, at least after changing the script name. However, only 1 file per WFOCycle is created. It contains 4 parameters, that is wrong or what I have misunderstood here?
Zorro creates the file in EXITRUN? How can i force the creation of separate files inside the for loops?