Assuming that HHV is the highest value of the High series over period 2, and Mov(,,S) is the Simple Moving Average for period 3....
CODE:
Please log in to see this code.
And for the full solution with parameter sliders:
CODE:
Please log in to see this code.