Optimization of Trading Systems