i am trying to write a function to perform some calculations of the highs and lows of the last X bars.. This function only needs to run once at the beginning after price data and system variables ... My questions are
1. how to use flag FIRSTRUN ? i have compiling error 'FIRSTRUN' undeclared identifier for the following script
if is(FIRSTRUN) printf ("Today is friday");
2. Does it work if i declare an int variable and use it to loop through the numbers of bars ?
Eg.
int z; for (z=0;z<11;z++) { if priceHigh(z)<priceHigh(z+1) s1=priceHigh(z+1) }
FIRSTRUN was for a beta version only - it is not yet defined in your Zorro version. For checking which flags your version has, click Help and look up "mode".
You can use the Bar variable for determining FIRSTRUN. It's the first run with Bar > 0.