Expert help: Close at the High(or Low) of two previous days

 
Can anyone help me with these code:
To close the buy order when price drop to the low of two previous days.
To close the Sell order when price raise to the high of two previous days.
Reason: