skip to main content
10.1145/3149869.3149872acmconferencesArticle/Chapter ViewAbstractPublication PagesscConference Proceedingsconference-collections
research-article

Real-Time Financial Risk Measurement of Dynamic Complex Portfolios with Python and PyOpenCL

Authors Info & Claims
Published:12 November 2017Publication History

ABSTRACT

Risk measures, such as value-at-risk and expected shortfall, are widely used to keep track of the risk at which a financial portfolio is exposed. This analysis is not only a key part of the daily operation of financial institutions worldwide, but it is also strictly enforced by regulators. While nested Monte Carlo simulations are the most flexible approach that can even deal with portfolios containing complicated derivatives, they traditionally suffer from a high computational complexity. This limits their application at certain intervals of time, mostly daily, by temporarily keeping the composition of the portfolio static.

In this work, we bring together for the first time nested Monte Carlo simulations with the real-time continuous risk measurement of complex portfolios that dynamically change their composition during intraday operation. By combining the development productivity offered by Python, state-of-the-art mathematical optimizations, and the high performance capabilities offered by PyOpenCL targeting heterogeneous computing systems, our new approach reaches a throughput between 16 and 191 trading orders per second per computing node, which corresponds to the worst-case and best-case scenarios respectively.

We have also made use of the Jupyter Notebook, as an interactive interface in an interdisciplinary research environment.

References

  1. 2014. Project Jupyter. Online. (2014). Retrieved October 10, 2017 from http://jupyter.org/Google ScholarGoogle Scholar
  2. 2017. Git. Online. (2017). Retrieved October 10, 2017 from https://git-scm.com/Google ScholarGoogle Scholar
  3. Achim Basermann, Melven Röhrig-Zöllner, and Joachim Illner. 2015. Performance and Productivity of Parallel Python Programming: A Study with a CFD Test Case. In Proceedings of the 5th Workshop on Python for High-Performance and Scientific Computing (PyHPC '15). ACM, 2:1--2:10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Barbara Chapman, Gabriele Jost, and Ruud van der Pas. 2007. Using OpenMP: Portable Shared Memory Parallel Programming (Scientific and Engineering Computation). The MIT Press.Google ScholarGoogle Scholar
  5. Jon Danielsson. 2011. Financial Risk Forecasting. Wiley.Google ScholarGoogle Scholar
  6. Sascha Desmettre, Ralf Korn, Javier Alejandro Varela, and Norbert Wehn. 2016. Nested MC-Based Risk Measurement of Complex Portfolios: Acceleration and Energy Efficiency. Risks 4, 4 (2016). http://www.mdpi.com/2227-9091/4/4/36Google ScholarGoogle Scholar
  7. Matthew F. Dixon, Thomas Bradley, Jike Chong, and Kurt Keutzer. 2012. Monte Carlo-Based Financial Market Value-at-Risk Estimation on GPUs. In GPU Computing Gems (jade ed.), Wen-Mei W. Hwu (Ed.). Vol. 2. Morgan Kaufmann, Chapter 25, 337--353. Google ScholarGoogle ScholarCross RefCross Ref
  8. Shayne Fletcher and Christopher Gardner. 2009. Financial Modelling in Python. Wiley Publishing.Google ScholarGoogle Scholar
  9. Python Software Foundation. 2017. The Python Tutorial. Online. (2017). Retrieved October 10, 2017 from https://docs.python.org/3/tutorial/Google ScholarGoogle Scholar
  10. Yves Hilpisch. 2014. Python for Finance: Analyze Big Financial Data (1st ed.). O'Reilly Media, Inc.Google ScholarGoogle Scholar
  11. Lee Howes and Aaftab Munshi. 2015. The OpenCL Specification. online. (Jan 2015). https://www.khronos.org/registry/cl/specs/opencl-2.1.pdfGoogle ScholarGoogle Scholar
  12. John C. Hull. 2012. Options, Futures, And Other Derivatives (8th ed.). Pearson.Google ScholarGoogle Scholar
  13. Intel. 2014. OpenCL Design and Programming Guide for the Intel Xeon Phi Coprocessor. Online. (2014). Retrieved October 10, 2017 from https://software.intel.com/en-us/articles/opencl-design-and-programming-guide-for-the-intel-xeon-phi-coprocessor?language=ruGoogle ScholarGoogle Scholar
  14. Adriaan Joubert and L.C.G. Rogers. 1997. Fast, accurate and inelegant valuation of American options. In Proceedings of the Numerical Methods Workshop at the Isaac Newton Institute, April 1995, L.C.G. Rogers and D. Talay (Eds.). Cambridge University Press, 88--92. http://www.statslab.cam.ac.uk/~chris/papers/aj2.pdf Google ScholarGoogle ScholarCross RefCross Ref
  15. Vadim Kartoshkin and Timothy Mattson. 2011. Tutorial: OpenCL - Introduction for HPC Programmers. (Mar 2011). https://software.intel.com/en-us/articles/tutorial-opencl-introduction-for-hpc-programmers last access: 31 Aug 2017.Google ScholarGoogle Scholar
  16. Andreas Klöckner, Nicolas Pinto, Yunsup Lee, Bryan Catanzaro, Paul Ivanov, and Ahmed Fasih. 2012. PyCUDA and PyOpenCL: A Scripting-based Approach to GPU Run-time Code Generation. Parallel Comput. 38, 3 (mar 2012), 157--174. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Christoph Lassner. 2016. PyMP. Online. (2016). Retrieved October 10, 2017 from https://github.com/classner/pympGoogle ScholarGoogle Scholar
  18. Alexander J. McNeil, RÃidiger Frey, and Paul Embrechts. 2005. Quantitative Risk Management: Concepts, Techniques, and Tools. Princeton University Press, Princeton and Oxford.Google ScholarGoogle Scholar
  19. Amit Mehta, Max Neukirchen, Sonja Pfetsch, and Thomas Poppensieker. 2012. Managing market risk: Today and tomorrow. McKinsey Working Papers on Risk 32. McKinsey & Company. http://www.mckinsey.com/business-functions/risk/our-insights/managing-market-risk-today-and-tomorrowGoogle ScholarGoogle Scholar
  20. Attilio Meucci. 2005. Risk and Asset Allocation. Springer, Berlin Heidelberg. Google ScholarGoogle ScholarCross RefCross Ref
  21. Attilio Meucci. 2010. Factors on Demand: Building a Platform for Portfolio Managers, Risk Managers and Traders. Risk 23, 7 (2010), 84--89. https://ssrn.com/abstract=1565134Google ScholarGoogle Scholar
  22. J. P. Morgan and Reuters. 1996. RiskMetrics: RiskMetrics Technical Document. Technical Report 4th ed. New York.Google ScholarGoogle Scholar
  23. Basel Committee on Banking Supervision. 2010. Basel III: A global regulatory framework for more resilient banks and banking systems. Technical Report. Bank for International Settlements. http://www.bis.org/publ/bcbs189.pdf (rev June 2011).Google ScholarGoogle Scholar
  24. David A. Patterson and John Hennessy. 2009. Computer Organization and Design (4 ed.). Morgan Kaufmann.Google ScholarGoogle Scholar
  25. James Reinders. 2012. An Overview of Programming for Intel Xeon processors and Intel Xeon Phi coprocessors. Intel, Online. (2012). Retrieved October 10, 2017 from http://download.intel.com/newsroom/kits/xeon/phi/pdfs/overview-programming-intel-xeon-intel-xeon-phi-coprocessors.pdfGoogle ScholarGoogle Scholar
  26. Javier Alejandro Varela and Norbert Wehn. 2017. Near Real-Time Risk Simulation of Complex Portfolios on Heterogeneous Computing Systems with OpenCL. In Proceedings of the 5th International Workshop on OpenCL (IWOCL 2017). ACM, New York, NY, USA, 2:1--2:10. http://doi.acm.org/10.1145/3078155.3078161Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Peter Vincent, Freddie Witherden, Brian Vermeire, Jin Seok Park, and Arvind Iyer. 2016. Towards Green Aviation with Python at Petascale. In SC16: International Conference for High Performance Computing, Networking, Storage and Analysis. 1--11. https://doi.org/10.1109/SC.2016.1Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Real-Time Financial Risk Measurement of Dynamic Complex Portfolios with Python and PyOpenCL

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          PyHPC'17: Proceedings of the 7th Workshop on Python for High-Performance and Scientific Computing
          November 2017
          81 pages
          ISBN:9781450351249
          DOI:10.1145/3149869

          Copyright © 2017 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 12 November 2017

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article
          • Research
          • Refereed limited

          Acceptance Rates

          Overall Acceptance Rate7of7submissions,100%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader