Backtesting trading strategies on simulated data in MATLAB
Contributors: Sandra Ng, Chris Chia, and Pearl Yuan
Complete List of Literature References
Model Free
one_over_n.m
- one-over-n (in units of each asset held)proportional
- one-over-n (in proportions)
Portfolio Optimisation
mean_variance.m
- standard Markowitz Mean-Variance Portfolio Optimisationridge_shrinkage.m
- Add lambda I to estimated covariance matrix and applying quadratic optimisationpca_optimisation.m
- Construct covariance matrix from PCA factors, and use in quadratic Optimisationledoit_wolf.m
- Ledoit and Wolf's Quadratic Shrinkage estimatormean_correlation.m
- Risk parity approach, using correlation matrix instead of covariance
Risk Parity
volatility_weighted.m
- Inverse volatility weightedhierarchial.m
- Hierarchial Risk Parity
Downside Risk Measures
semicovariance.m
- Risk Parity approach using semivariance (as a quadratic optimisation problem)cvar_optimisation.m
- CVaR portfolio optimisation as a linear programming problemmad_optimisation.m
- MAD portfolio optimisation as a linear programming problem
Momentum
current_price_weighted.m
- current price-Weighted Strategymacd.m
- allocate weights based on MACD oscillatorclassification.m
= allocate weights based on prediction of signreg.m
= allocate weights based on prediction of returns
Online
exp_grad_proj.m
- exponential gradient, projective updateexp_grad_mult.m
- exponential gradient, multiplicative updateexp_grad_max.m
- exponential gradient, expectation maximisationfollow_leader.m
- Follow the (regularised) leader
- Conditional Drawdown at Risk
cdar_optimisation.m
- Entropic VaR
Sjöstrand, K., Clemmensen, L., Larsen, R., Einarsson, G., & Ersbøll, B. (2018). SpaSM: A MATLAB Toolbox for Sparse Statistical Modeling. Journal of Statistical Software, 84(10), 1 - 37. doi:http://dx.doi.org/10.18637/jss.v084.i10
Ledoit, O. and Wolf, M. Quadratic shrinkage for lage covariance matrices.
- Corresponding code from: https://www.econ.uzh.ch/en/people/faculty/wolf/publications.html#9
Asset Allocation - Hierarchical Risk Parity
Mean Absolute Deviation
- Statistics and Machine Learning Toolbox
- MFE-Toolbox
- MATLAB Econometrics Toolbox, Financial Toolbox
- https://github.com/dcajasn/Riskfolio-Lib
- https://github.com/microsoft/qlib
- https://github.com/AI4Finance-LLC/FinRL-Library
- https://uk.mathworks.com/matlabcentral/fileexchange/9061-risk-and-asset-allocation?s_tid=prof_contriblnk
- https://hudson-and-thames-portfoliolab.readthedocs-hosted.com/en/latest/utils/risk_metrics.html
- https://github.com/robertmartin8/PyPortfolioOpt
- https://cran.r-project.org/web/packages/parma/vignettes/Portfolio_Optimization_in_parma.pdf