This strategy will enter and exit as stated, but only on every other bar, and it isn't really a solution for the question posed.