This project opts to simulate Contrarian and Momentum strategies over a specified period to examine the impact of transaction costs. In this implementation, transaction costs are calculated via Roll’s model.
The stock data are stored as a filesystem database created via a dataDownload.m matlab file.
- datetime
- argparse
- backtrader
- pandas
- collections
- random
- shutil
- matplotlib<=3.2.2
- Make sure you have python 3 installed.
- Cd to the project directory and execute
pip install -r requirements.txt
The following files and folders should exist inside the working directory in order to execute:
- LIBOR USD-3.csv
- libor.py
- myIndicators.py
- mystrategies.py
- Simulation.py
- Database
To execute you can either modify the predefined example at Simulation.py and execute the file Simulation.py as a python script or Import Simulation.py as a module and create your own scenario.