{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,4,21]],"date-time":"2026-04-21T14:52:19Z","timestamp":1776783139762,"version":"3.51.2"},"reference-count":20,"publisher":"MDPI AG","issue":"1","license":[{"start":{"date-parts":[[2013,3,22]],"date-time":"2013-03-22T00:00:00Z","timestamp":1363910400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/3.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Algorithms"],"abstract":"<jats:p>Portfolio optimization is one of the problems most frequently encountered by financial practitioners. The main goal of this paper is to fill a gap in the literature by providing a well-documented, step-by-step open-source implementation of Critical Line Algorithm (CLA) in scientific language. The code is implemented as a Python class object, which allows it to be imported like any other Python module, and integrated seamlessly with pre-existing code. We discuss the logic behind CLA following the algorithm\u2019s decision flow. In addition, we developed several utilities that support finding answers to recurrent practical problems. We believe this publication will offer a better alternative to financial practitioners, many of whom are currently relying on generic-purpose optimizers which often deliver suboptimal solutions. The source code discussed in this paper can be downloaded at the authors\u2019 websites (see Appendix).<\/jats:p>","DOI":"10.3390\/a6010169","type":"journal-article","created":{"date-parts":[[2013,3,22]],"date-time":"2013-03-22T12:44:31Z","timestamp":1363956271000},"page":"169-196","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":21,"title":["An Open-Source Implementation of the Critical-Line Algorithm for Portfolio Optimization"],"prefix":"10.3390","volume":"6","author":[{"given":"David","family":"Bailey","sequence":"first","affiliation":[{"name":"Lawrence Berkeley National Laboratory, 1 Cyclotron Road, Berkeley, CA 94720, USA"},{"name":"Department of Computer Science, University of California, Davis, CA 95616, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Marcos","family":"L\u00f3pez de Prado","sequence":"additional","affiliation":[{"name":"Lawrence Berkeley National Laboratory, 1 Cyclotron Road, Berkeley, CA 94720, USA"},{"name":"Hess Energy Trading Company, 1185 Avenue of the Americas, New York, NY 10036, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"1968","published-online":{"date-parts":[[2013,3,22]]},"reference":[{"key":"ref_1","first-page":"77","article-title":"Portfolio selection","volume":"7","author":"Markowitz","year":"1952","journal-title":"J. Financ."},{"key":"ref_2","unstructured":"Beardsley, B., Donnadieu, H., Kramer, K., Kumar, M., Maguire, A., Morel, P., and Tang, T. (2012). Capturing Growth in Adverse Times: Global Asset Management 2012. [Research Paper, The Boston Consulting Group]."},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"111","DOI":"10.1002\/nav.3800030110","article-title":"The optimization of a quadratic function subject to linear constraints","volume":"3","author":"Markowitz","year":"1956","journal-title":"Nav. Res. Logist. Q."},{"key":"ref_4","unstructured":"Markowitz, H.M. (1959). Portfolio Selection: Efficient Diversification of Investments, John Wiley and Sons. [1st ed.]."},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"382","DOI":"10.2307\/1909468","article-title":"The simplex method for quadratic programming","volume":"27","author":"Wolfe","year":"1959","journal-title":"Econometrica"},{"key":"ref_6","unstructured":"Markowitz, H.M., and Todd, G.P. (2000). Mean Variance Analysis in Portfolio Choice and Capital Markets, John Wiley and Sons. [1st ed.]."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"785","DOI":"10.1145\/358198.358217","article-title":"The EAS-E application development system: principles and language summary","volume":"27","author":"Markowitz","year":"1984","journal-title":"Commun. ACM"},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"199","DOI":"10.1007\/s11573-006-0006-z","article-title":"Portfolio optimization: New capabilities and future methods","volume":"76","author":"Steuer","year":"2006","journal-title":"Z. Betriebswirtschaft"},{"key":"ref_9","unstructured":"Kwak, J. The importance of Excel. The Baseline Scenario, 9 February 2013. Available online: http:\/\/baselinescenario.com\/2013\/02\/09\/the-importance-of-excel\/."},{"key":"ref_10","unstructured":"Hirschberger, M., Qi, Y., and Steuer, R.E. (2004). Quadratic Parametric Programming for Portfolio Selection with Random Problem Generation and Computational Experience. [Working Paper, Terry College of Business, University of Georgia]."},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Niedermayer, A., and Niedermayer, D. (2007). Applying Markowitz\u2019s Critical Line Algorithm. [Research Paper Series, Department of Economics, University of Bern].","DOI":"10.2139\/ssrn.894842"},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"28","DOI":"10.2469\/faj.v48.n5.28","article-title":"Global portfolio optimization","volume":"48","author":"Black","year":"1992","journal-title":"Financ. Anal. J."},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"3","DOI":"10.21314\/JOR.2012.255","article-title":"The sharpe ratio efficient frontier","volume":"15","author":"Bailey","year":"2012","journal-title":"J. Risk"},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Meucci, A. (2005). Risk and Asset Allocation, Springer. [1st ed.].","DOI":"10.1007\/978-3-540-27904-4"},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Kopman, L., and Liu, S. (2009). Maximizing the Sharpe Ratio, MSCI Barra Research Paper No. 2009-22.","DOI":"10.2139\/ssrn.1437644"},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"265","DOI":"10.1080\/00150517.1966.12431364","article-title":"Optimality proof for the symmetric Fibonacci search technique","volume":"4","author":"Avriel","year":"1966","journal-title":"Fibonacci Q."},{"key":"ref_17","unstructured":"Dalton, S. (2007). Financial Applications Using Excel Add-in Development in C\/C++, John Wiley and Sons. [2nd ed.]."},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"502","DOI":"10.1090\/S0002-9939-1953-0055639-3","article-title":"Sequential minimax search for a maximum","volume":"4","author":"Kiefer","year":"1953","journal-title":"Proc. Am. Math. Soc."},{"key":"ref_19","unstructured":"David, H. Bailey\u2019s Research Website. Available online: www.davidhbailey.com."},{"key":"ref_20","unstructured":"Marcos L\u00f3pez de Prado\u2019s Research Website. Available online: www.quantresearch.info."}],"container-title":["Algorithms"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1999-4893\/6\/1\/169\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,11]],"date-time":"2025-10-11T21:45:43Z","timestamp":1760219143000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1999-4893\/6\/1\/169"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2013,3,22]]},"references-count":20,"journal-issue":{"issue":"1","published-online":{"date-parts":[[2013,3]]}},"alternative-id":["a6010169"],"URL":"https:\/\/doi.org\/10.3390\/a6010169","relation":{},"ISSN":["1999-4893"],"issn-type":[{"value":"1999-4893","type":"electronic"}],"subject":[],"published":{"date-parts":[[2013,3,22]]}}}