Machine Learning In Stock Indices Trading And Pairs Trading