On another message board I saw an automated system that self-optimized in real time. (I don't know if it's OK to post links to other boards).
Basically it waited for highs/lows and looked at recent history to see if trading a breakout was more profitable or if trading counter was. You set the SL and TP values and how far back to look. So if recent market conditions said that 60% of the time breakouts were favorable, you'd be told to go long on a new high. If recent market conditions said that 60% of the time counter trends were profitable, you'd be told to go short on a new high. That 60% number I used is set by the user as well.