Interesting indicator needed

 

If can anybody help producing an indicator with the following criteria:

Variables: Time frame (1h), X=open of the period of calculation (1 to 24 of the platform), Y=Period of calculation (1 to 24), Z= number of calculation days (1 to 10).

Numerical output: Maximum pips in the last z periods accounted from X to the high for a y period, Maximum pips in the last z periods accounted from X to the low for y period, Average pips in the last z periods accounted from X to the high for a y period, Average pips in the last z periods accounted from X to the low for y period.

Thanks in advance

Zeinoun

 

To help understand the idea, I made an example on the attached excel Sheet

Zeinoun

Files:
example.xlsx  12 kb
Reason: