Hi All
I came across the below linked post on babypips.com. I have been testing and adjusting the code but I am unable to get results that are similar to the original poster's. I have a few thoughts on why, but my Zorro programming skills are limited. I have been unable to contact the original poster. So I was hoping the group could help me fix the code.
Link to original post:
http://forums.babypips.com/expert-advisors-automated-trading/47462-my-zorro-adventure.htmlI think there might be two problems. The first is that the code is for an earlier version of Zorro and some syntax needs to be updated. The second is that it seems to be very sensitive to the WFO parameters. So I need to understand how to set these both for testing and ongoing development and trading. I assume that since time moves forward and new data is downloaded, the WFO start date should be fixed. However the cycles will get longer if number of cycles is fixed. hmmmm uncertain about this in practice.
I had a go at fixing it, but I think it is best to get comments based on the original code. The original poster worked with EURUSD. If successful, I will add the loops to cover more symbols, and position size code, and repost.
Thanks
function run()
{
BarPeriod = 240;
StartDate = 2006;
NumYears = 7;
NumWFOCycles = 12;
Mode = PARAMETERS+TESTNOW;
var *Price = series(price());
var *LP5 = series(LowPass(Price,5));
var *LP10 = series(LowPass(Price,optimize(10,6,20)));
var *RSI10 = series(RSI(Price,10));
Stop = optimize(5,1,10)*ATR(30);
static int crossed = 0;
if(crossOver(LP5,LP10))
crossed = 3;
else if(crossUnder(LP5,LP10))
crossed = -3;
if(crossed > 0 && crossOver(RSI10,50))
{
enterLong();
crossed = 0;
}
else if(crossed < 0 && crossUnder(RSI10,50))
{
enterShort();
crossed = 0;
}
else crossed -= sign(crossed);
}