Yes, the comparison is wrong and LOOKBACK is a flag - what you meant was LookBack. C is case sensitve.

The "P[0]=high[highndx];" line however is correct.