An Algorithmic Trading Framework for Investing in Stocks in the S&P 500
A capstone project developed and submitted for the fullfillment of the requirements for the M.S. degree in Information at the University of Arizona.
pip install -r requirements.txt
You will also need to install MongoDB
The two important collections that I have included in the repository are the fundamentals and the technicals. This data from the database was exported into two json files: Database/Fundamentals.json and database/Technicals.json. To import this data into collections in a new database on a local machine, run:
mongo use AlgoTradingDB
mongo import --db AlgoTradingDB --collection 10y_Fundamentals --file Database/Fundamentals.json --jsonArray
mongo import --db AlgoTradingDB --collection 5Y_technicals --file Database/Technicals.json --jsonArray
This will create a mongo database called AlgoTradingDB and two collections within that database called 10y_Fundamentals and 5Y_technicals. The trading system will get data from these two collections and create new collections within this database from the trading results.
To run the trading system, you run tradingSystem.py with the virtual environment. The arguments are
- Starting Date YYYY-MM-DD (default = 2017-09-05)
- Starting Capital (default = 15000)
- Predictive Model (Arima, SVM, or LSTM) (default = SVM)
- Amount of loss you are willing to lose (default = 0.3)
- Stock Ticker
python environment.py --model SVM --startDate 2017-09-05 --startingCapital 15000 --ticker googl --loss 0.3
To run the trading system, you run tradingSystem.py with the virtual environment. The arguments are
- Starting Date YYYY-MM-DD (default = 2017-09-05)
- Starting Capital (default = 15000)
- Predictive Model (Arima, SVM, or LSTM) (default = SVM)
- Amount of loss you are willing to lose (default = 0.3)
python tradingSystem.py 2017-09-05 15000 SVM 0.3
This project is licensed under the MIT License - see the LICENSE.md file for details