This dataset and accompanying code archive form part of a 2025 BCom Honours project in the Department of Statistical Sciences at the University of Cape Town. The study investigates a generalised pairs trading framework using online learning and nearest-neighbour pattern matching, following the non-parametric portfolio selection methods of Györfi et al. and the extended agent-based formulation of Loonat & Gebbie.
The project develops an adaptive long–short trading strategy that combines:
The approach is tested across three South African asset classes - JSE equities, ZAR currency pairs, and SA government bonds - using both weekly and monthly data, along with a comprehensive suite of synthetic datasets (GBM, lognormal, ARMA, GARCH). The MATLAB implementation is fully modular and designed for reproducibility, allowing users to replicate results or extend the methodology to new universes.
The deposited files include:
• cleaned real-world datasets (JSE equities, FX crosses, SA bonds)
• synthetic datasets used for stress testing
• the complete MATLAB codebase for the pattern-matching portfolio class
• experiment scripts for generating results
• all output figures used in the thesis
• the final Honours thesis PDF
This item provides a reproducible research package for students and researchers interested in non-parametric portfolio selection, statistical arbitrage, pattern-matching methods, and online learning in financial markets.