It enters a long position when the close price is greater than the previous high and enters a short position when the close price is lower than the previous low. It also includes exit conditions that close positions when the opposite condition is met.