High and Low Moving average strategy

Hello!
I need to make a strategy which gives a buy signal when closing price of two candle is above 10 moving average high, and a sell signal closing price of two candle is below 8 moving average low.