Project Update


This week I’d like to spend some time talking about our capstone project by giving a general overview of the tools and technology we are using to build it and our progress up to this point.

Our project goal is to create a web app for testing algorithmic stock market trading strategies. More specifically we want to enable users to upload their own strategies to the app, then run backtests against them with custom parameters and datasets. Finally, they should be able to view the results of previous backtests to inform their choices when writing future algorithms.

The most important tool we are using to create the app is called QuantConnect LEAN. QuantConnect LEAN is an engine that facilitates backtesting and live-trading with stock market trading strategies. Strategies are represented by algorithms that implement interfaces from the QuantConnect LEAN engine, written in either C# or Python. So, users write their algorithms to implement QuantConnect LEAN interface, then upload them to our app. Then they trigger a backtest to be run, which is initiated on the web server using the QuantConnect LEAN command line interface. QuantConnect LEAN puts the results of the backtest in a .json file, which is then read by the web server into a database that stores the backtest results in a structured table. Our web server is running on Flask, and our database is implemented in MySQL.

At this point we have a web app that is capable of taking an algorithm uploaded by the user, storing it in a new QuantConnect LEAN project, running a backtest against it using a canned dataset, and displaying the results to the user. So, we have implemented the end-to-end flow of the application, but still have some work to do on the details of the app. My current objective is to produce custom plots of backtest results to be displayed in addition to the results of a backtest that QuantConnect LEAN supplies. So far I am able to create an image file that contains a plot of portfolio equity using a library called matplotlib, then store this file in a database and later fetch it to be displayed with the results of the corresponding backtest. Most recently, I am dealing with challenges of serving the image from the database to the front-end of the app. This is the first time I have dealt with serving images from a database, so I am learning a lot!

With only a few weeks left in the term, we have our eye on the challenge of deploying our project to an AWS EC2 instance backed by an RDS. Some team members have already begun working on this, and we look forward to sharing our public project with anyone that is interested in using it!

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *