Optimizing trading strategies with machine learning