hello all,

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) }

Many thanks !