so the code that needs to be repeated would be the code that has to do with producing the indicator? i.e.
int s_iMa_Handle = iMA(pair.names[i], pair.periods[j],slow_iMa,0,MODE_SMA,PRICE_CLOSE);
you mean this code?
if(CopyBuffer(s_iMa_Handle, 1, 0, y, s_Ma)<=0) Print("Error copying slow Ma...