Maximum value of the bar

 
How to calculate the maximum value of a bar within a period of 10 bars?

I'll use this to calculate the resistance in this period.
 

maybe

double maxOfLast10Bars = iHigh(NULL, 0, iHighest(NULL, 0, MODE_HIGH, 10, ix));

will do what you want.

NB code just typed; not compiled or checked

Reason: