This project consists of a proof of concept and conceptual demo of a simple stat-arb trading strategy that is based upon cointegration methods. View ./paper/Cointegration-Based spread trading applied to the foreign exchange market.pdf
for a theoretical overview on the relevant statistical methods. The conceptual demo in this project implements the trading strategy that is explained in Chapter 4 of the paper. It is important to note the academic nature of the project: The demo trading results contain a severe lookahead bias because the strategy is executed on in-sample data. Hence, the trading results will most likely not correspond with realistic out of sample trading.
The entrance point to the demo is ./demo.R
and the functionality is well documented inside the script. Following functionality is executed:
.csv
files which are provided in the ./data
directory. It should be noted that all relevant timeseries are recreated in such a way that the USD currency pair becomes the quoted pair, for consistency reasons.View the ./images
folder for graphical illustrations of the trading results.
In the event of problems or errors while running the code, make sure that your R version is up to date and all the required subpackages that are mentioned in ./config.r
are installed properly. Uncommenting and executing the first 4 lines in ./config.R
should resolve most potential problems that might occur. Also view the extended comments inside the ./classes
and ./functions
files for additional insight on the technical implementation details.
Copyright 2015 Jellen Vermeir. jellenvermeir@gmail.com
Cointegration-Based Statistical Arbitrage Trading Strategy is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Cointegration-Based Statistical Arbitrage Trading Strategy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with Cointegration-Based Statistical Arbitrage Trading Strategy. If not, see http://www.gnu.org/licenses/.
Following people are given credit for the co-authoring of the attached paper: