I tested a very simple system using 2 external EOD data sets as "indicators":

#include <contract.c>

var ExtInd1() { return dataFromCSV(101,"+%m/%d/%Y,f","Data1.csv",1); }
var ExtInd2() { return dataFromCSV(102,"+%m/%d/%Y,f","Data2.csv",1); }

void run()
{
BarPeriod = 1440;

vars Diff = series(ExtInd1()-ExtInd2());

if(crossUnder(Diff,0))
enterLong();

if(crossOver(Diff,0))
enterShort();
}


Test results were looking too good to be true and I finally realized that Zorro is entering positions at the OPEN of the SAME daily bar the crossovers are signalled based on the external data. However, the external data is from END of day, so effectively Zorro was using indicator data that would not have been known yet in reality, hence the almost perfect results.

Now I wonder if this is just a conceptual misunderstanding of mine or eventually a Zorro bug? Or in other words, how to avoid this from happening? Actually Zorro should open the trade either at the close of the current bar or at the open of the next daily bar... Ok, I could shift the series Diff by 1 bar for the crossOver() condition but this looks like a dirty workaround to me.

Any recommendations how to do this the "correct" way?