This repository contains the source code used for my undergraduate thesis.
Ensure you have Python installed on your system. TensorFlow 2 supports:
- Python: 3.8–3.11
- Operating Systems:
- Ubuntu 16.04 or later
- Windows 7 or later (with C++ redistributable)
- macOS 10.12.6 (Sierra) or later (no GPU support)
- WSL2 via Windows 10 19044+ (Experimental GPU support)
Verify Python installation:
python3 --version # python --version for Windows
If Python is not installed, download it from the official website.
With the virtual environment activated, install the required packages:
pip install --upgrade pip
pip install -r requirements.txt
Make sure to download the GPU drivers if not running on the cloud here
To scrape PSE stock data, run:
python scrape_data.py
This script utilizes tickers.txt
to determine which stocks to fetch and stores the data in the data/
directory.
The provided notebook runs the methodology outlined in the paper. It skips the data collection part since it is already collected via scrape_data.py
, and ends with the backtesting simulations.
Run it via:
jupyter notebook notebook.ipynb
The repository organizes data as follows:
/pse-stocks
├── data/
└── predictions/
└── results/
data/
: Contains scraped stock data from MarketWatch.predictions/
: Contains actual vs predicted price plots for the final model.results/
: Contains backtesting results for each strategies.
The project saves the final trained model to a file called model.keras
, which can be loaded for other uses.