average high of a custom array within indicator

 

Hi all,


So i'm needing a little advice to calculate the average high of a custom array set of the the last x candles.

I calculate a live spread  of 3 instruments which is held in an array called 'LiveSpread' and i then calculate the moving average of this which is held in a buffer:

double livespread =((iClose(ccy1,PERIOD_CURRENT, k)*iClose(ccy2, PERIOD_CURRENT, k))-iClose(ccy3, PERIOD_CURRENT, k));      
ExtMaBuffer[i] = MA(i,ma);

Now the bit i'm stuck with is how can i then use this to calculate the average highest and lowest over the last x candles, initially i thought of using iHighest and iLowest, but these functions require a string symbol which i won't have given the ma array consists of a calculation of 3 instruments.

Any advice to point me in the right direction would be much appreciated

Thanks in advance