SOFTWARE
Several of my papers discuss implementations of various algorithms in Python language. This facilitates the replication of my results, and allows the reader to run independent experiments. Enthought's Canopy product contains all the necessary libraries. Although the code is generally included in the appendix, it is easier to download the source code from the table below. In order to do that, please follow these steps:
1) Point your mouse on a link.
2) Rightclick, select "Save as" and press "Save".
3) Rename the saved file, by removing the extension ".txt"
Note: All code in this website is provided “as is”, and contributed to the
academic community for nonbusiness purposes only, under a GNUGPL license.
Users explicitly renounce to any claim against the authors. The authors retain
the commercial rights of any forprofit application of this software, which must
be preauthorized in written by the authors.
AUTHOR 
VERSION 
LINK 
PAPER 
DESCRIPTION 

The Tenure Maker Simulator  This online tools overfits an econometric investment strategy within the parameter ranges specified by the user.  
Berkeley Lab 
2014 
Backtest Overfitting Simulator  This online tools overfits a seasonal investment strategy within the parameter ranges specified by the user. Special thanks to Stephanie Ger, who set up this web application and prepared this research poster.  
20151227 
HRP.py.txt HRP_MC.py.txt 
Building Diversified Portfolios that Outperform OutOfSample 
HRP.py performs a hierarchical portfolio construction. Changing the np.random.seed in generateData() will produce different random correlation matrices on which the method can be tested. HRP_MC.py runs a Monte Carlo experiment to show that HRP solutions deliver lower variance than CLA's outofsample, even though minimumvariance is CLA's optimization goal.  
20140731 
DSR.py.txt 
The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting and NonNormality 
DSR.py computes the expected value of the maximum of a series of IID Normal random variables, applying our closedform solution. The accuracy of this solution is verified numerically.  
20140407 
KCA_1.py implements the Kinetic Component
Analysis (KCA) algorithm. KCA_2.py carries out the analogous
calculation using a Fast Fourier Transform (FFT). KCA_3.py performs a
comparison of KCA vs. FFT. KCA_4.py compares KCA with the Locally
Weighted Scatterplot Smoothing (LOWESS) method. 

20140131 
Determining Optimal Trading Rules without Backtesting 
OTR.py contains the code needed to
determine the Optimal Trading Rule (OTR) on an instrument with a price that
follows a discrete OrnsteinUhlenbeck process. 

20140119 
SFD_1.py contains the code needed to build
Stochastic Flow Diagrams. 

20140119 
The Topology of Macro
Financial Flows: An Application of Stochastic Flow Diagrams 
SFD_2.py implements Fisher's variance
stabilizing transformation on the Correlation coefficient. 

20130813 
CSCV_1.py implements the PBO estimation via
Monte Carlo. CSCV_2.py implements the PBO estimation by Extreme Value
Theory. 

20130813 
CSCV_3.py simulates the performance of a
seasonal trading strategy under various overfitting
scenarios, which can be used to corroborate the Probability of Backtest Overfitting (PBO)
usefulness in real investment applications. 

20130108 
DD1.py.txt 
DD1.py contains the Monte Carlo which confirms the accuracy of
our closeformula derivation of the quantile
function. DD2.py computes the maximum of the Drawdown (DD) function,
under the more general assumption of firstorder seriallycorrelated outcomes.
DD3.py the maximum of the Time under Water (TuW) function, under the more
general assumption of firstorder seriallycorrelated outcomes. DD4.py
reproduces our empirical analysis on hedge fund indices (Data1.csv and
Data2.csv). 

20130108 
An OpenSource implementation of the CriticalLine
Algorithm for Portfolio Optimization 
A Python class containing the CriticalLine Algorithm for
quadratic optimization subject to inequality constraints. CLA.py is the
class. CLA_Main.py is an example of how to use the CLA class.
CLA_Data.csv
is sample data. A seminar on this code can be watched here, and the presentation downloaded here. Enthough has built a GUI on our CLA class, which can be
downloaded here. 

20120516 
Balanced Baskets: A
New Approach to Trading and Hedging Risks 
ERC basket optimization algorithm. 

20120516 
Balanced Baskets: A
New Approach to Trading and Hedging Risks 
MMSC basket optimization algorithm. 

20120516 
Balanced Baskets: A
New Approach to Trading and Hedging Risks 
Covariance clustering algorithm. 

20120502 
Implementation of PSR statistics. 

20120502 
Implementation of PSR portfolio
optimization. 

20120316 
Determination of the optimal execution horizon. 

20120217 
Markowitz meets
Darwin: Portfolio Oversight and Evolutionary Divergence 
Implementation of the EF3M algorithm. 