I'm thinking that the following should work:
function run()
{
vars P=series();
vars high=series(priceHigh());
int highndx;
int i;
for(i=0;i=LOOKBACK;i++)
{
if(high[i]<high[i+1])
{
highndx = i+1;
break;
}
}
P[0]=high[highndx];
}
But I am obviously wrong as I get a syntax error on the P[0]=high[highndx] . Pretty certain the problem has something to do with pointers. This hsa to be something stupid that I have missed because it it too stupid. Certainly you can move an array value to an array value.
Thanks
P
edit where error is.
Last edited by Pork; 08/26/13 18:20.