Hi zcom001. Don't have time right now to look in detail or try to correct, but my 1st reaction is you should use a series for ITrend, not an array. There are examples in indicators.c, among other places.

HTH.