One of the first things I ever backtested was : (1) Let B = bias, where B = 1 for long, and B = -1 for short. Initially select B randomly. (2) Enter trade with bias B. (3) If trade in (2) is a winner, bias remains unchanged. If trade in (2) is a loser, reverse bias (ie. B = -B). (4) Go to (2).