Machine Learning Algorithmic Trading Project

This project was to create a trading algorithm for use in the S&P 500 futures. The project uses python to make the model and is executed in C++ ran in the trade platform.

Details

The algorithmic trading project was built using python to pull data from trade files that captured every trade made on the E-Mini Futures contract (S&P 500). I went through and labeled trades that were winning trades that fit a developed system. I built scripts to pull the data from the trade files starting from the beginning of the day up to the labeled traded. From there, I created approximately 30 features that I believed described the trades as best as possible. I then started with a simple decision tree classification model to label trades as either true or false. I optimized my feature algorithms to get the best results as possible with the simplest model, and then continued to using more advanced models. Through this process I used a Random Forest Model and then landed on a gradient boosting algorithm that gave the best results.

Once the process of finding the best model was complete using a test data set, I set up similar algorithms to capture the identical features in C++ so I could capture the features live when running the trading software. The end result is a live trading system that evaluates trade data to create the features. Those features are piped over to a running python script to be run through the trained model, the result True or False is sent back to the trading script to either execute a trade or to do nothing. That is what is shown in the video above.

Scripts / Algorithms

To make this all work, there were a number of scripts that were created to process data and run tests. These are listed below:

Lessons Learned

There are many lessons learned while doing this, but here are a few:

Accomplishments

Improvements and Other Variations to Try