In Backtests, Zorro seems to differentiate between compiling (and running the script) and just running the script. The latter just calls the run function and ignores everything else, which can cause problems when using global variables.
As an example:
// ---------------------------------------------------
int zaehler = 0;
function run()
{
StartDate = 20090520;
EndDate = 20120501;
zaehler++;
plot("asdf",zaehler,0,BLACK);
PlotWidth = 800;
PlotHeight1 = 320;
}
// -----------------------------------
With every subsequent run of this script zaehler is not reinitialised as 0 but keeps the value of the previous run, which is kind of strange for a Backtest.
My questions are:
1) How does this affect real trading?
and
2) Is there a way to code the example in a way it works properly on every run?