sell and buy after detecting pattern