I am currently building an investment tool that uses AI to group similar stocks, enabling accurate price forecasting.
I utilize an object-oriented approach to maximize readability and reusability. I use Pandas to store the data, Pandas and NumPy to perform computations on the data, and PyTorch to train a reinforcement learning model for the trading logic.
Originally, the entire pipeline (involving over 20 million computations) took over 4 hours to complete. Through careful performance optimizations, dynamic programming, and using multiprocessing, I reduced the runtime from 4 hours to 8 minutes, a 30x performance speedup.
From simulations on real market data, my method outperformed the market by 5% over a 15-year period. In real-life, my method outperformed the market by 15% over a 3-month period.