𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Learning Modern C++ for Finance: Foundations for Quantitative Programming (Fourth Early Release)

✍ Scribed by Daniel Hanson


Publisher
O’Reilly Media, Inc.
Year
2023
Tongue
English
Leaves
204
Edition
4
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


A lot of financial modeling has gravitated toward Python, R, and VBA, but many developers hit a wall with these languages when it comes to performance. This practical book demonstrates why C++ is still one of the dominant production-quality languages for financial applications and systems. Many programmers believe that C++ is too difficult to learn. Author Daniel Hanson demonstrates that this is no longer the case.

Financial programmers coming from Python or another interpreted language will discover how to leverage C++ abstractions that enable safer and quicker implementation of financial models. You'll also explore how popular open source libraries provide additional weapons for attacking mathematical problems. C++ programmers unfamiliar with financial applications will also benefit from this handy guide.

Before launching into programming in C++, it will be useful to present a brief overview of the language the C++ Standard Library, and the ways in which C++ continues to have a major presence in quantitative finance. You may have already felt intimidated by opinions and rumors claiming that C++ is extraordinarily difficult to learn and fraught with minefields. So, in this chapter, we will try to allay these fears by first debunking some of the common myths about C++, and then presenting straightforward examples to help you get up and running.

Learn C++ basics: syntax, inheritance, polymorphism, composition, STL containers, and algorithms
Dive into newer features and abstractions including functional programming using lambdas, task-based concurrency, and smart pointers
Employ common but nontrivial financial models in modern C++
Explore external open source math libraries, particularly Eigen and Boost
Implement basic numerical routines in modern C++
Understand best practices for writing clean and efficient code

✦ Table of Contents


  1. An Overview of C++
    C++ and Quantitative Finance
    C++ 11: The Modern Era is Born
    Open Source Mathematical Libraries
    Debunking Myths About C++
    Compiled vs Interpreted Code
    The Components of C++
    C++ Language Features
    The C++ Standard Library
    Compilers and IDE’s
    Basic Review of C++
    Good Old β€œHello World!”
    Simple Procedural Programming in C++
    C++ Syntax and Style Guidelines
    Mathematical Operators, Functions, and Constants in C++
    Standard Arithmetic Operators
    Mathematical Functions in the Standard Library
    Constants
    Conclusion
    References
  2. Some Mechanics of C++
    The vector Container
    Setting and Accessing Elements of a vector
    Concluding Remarks on STL vectors
    Enum Constants and Classes
    Enum Constants
    Potential Conflicts with Enums
    Enum Classes
    Control Structures
    Conditional Branching
    Iterative Statements
    Aliases
    Type Aliases
    References
    Pointers
    Function and Operator Overloading
    Function Overloading
    Operator Overloading
    Summary
    References
  3. Writing User-Defined Functions and Classes in Modules
    Using Modules to Write User-Defined Functions
    A First Example with Non-Member Functions
    Standard Library Header Units
    Modules Prevent Leaking into Other Modules
    A Black-Scholes Module Example
    User-Defined Class Implementation in Modules
    Using Namespaces with Modules
    Summary
  4. Dates and Fixed Income Securities
    Representation of a Date
    1.1 Serial Representation and Date Differences
    1.2 Accessor Functions for Year, Month, and Day
    1.3 Validity of a Date
    1.4 Leap Years and Last Day of the Month
    1.5 Weekdays and Weekends
    1.6 Adding Years, Months, and Days
    1.6.1 Adding Years
    1.6.2 Adding Months and End-of-the-Month Cases
    1.6.3 Adding Days
    A Date Class Wrapper
    Class Declaration
    Public Member Functions and Operators
    Private Members and Helper Function
    Class Implementation
    Day Count Bases
    Yield Curves
    Deriving a Yield Curve from Market Data
    A Yield Curve Class
    A Linearly Interpolated Yield Curve Class Implementation
    A Bond Class
    Bond Payments and Valuation
    A Bond Class
    Bond Class Implementation
    A Bond Valuation Example
    Summary
    References
  5. Linear Algebra
    Introduction
    valarray and Matrix Operations
    Arithmetic Operators and Math functions
    valarray as a Matrix Proxy
    Eigen
    Lazy Evaluation
    Eigen Matrices and Vectors
    Matrix and Vector Math Operations
    STL Compatibility
    Matrix Decompositions and Applications
    Future Directions: Linear Algebra in the Standard Library
    mdspan (P0009)
    BLAS Interface (P1673)
    Linear Algebra (P1385)
    Summary (Linear Algebra Proposals)
    Chapter Summary
    References
    About the Author

πŸ“œ SIMILAR VOLUMES


Learning Modern C++ for Finance: Foundat
✍ Daniel Hanson πŸ“‚ Library πŸ› O'Reilly Media 🌐 English

<p><span>A lot of financial modeling has gravitated toward Python, R, and VBA, but many developers hit a wall with these languages when it comes to performance. This practical book demonstrates why C++ is still one of the dominant production-quality languages for financial applications and systems.

Learning Modern C++ for Finance (Fifth E
✍ Daniel Hanson πŸ“‚ Library πŸ“… 2023 πŸ› O'Reilly Media, Inc. 🌐 English

A lot of financial modeling has gravitated toward Python, R, and VBA, but many developers hit a wall with these languages when it comes to performance. This practical book demonstrates why C++ is still one of the dominant production-quality languages for financial applications and systems. Many prog

Probabilistic Machine Learning for Finan
✍ Deepak Kanungo πŸ“‚ Library πŸ“… 2023 πŸ› O'Reilly Media, Inc. 🌐 English

Whether based on academic theories or machine learning strategies, all financial models are at the mercy of modeling errors that can be mitigated but not eliminated. Probabilistic ML technologies are based on a simple and intuitive definition of probability and the rigorous calculus of probability t

Learn to Program with Assembly: Foundati
✍ Jonathan Bartlett πŸ“‚ Library πŸ“… 2021 πŸ› Apress 🌐 English

<div>Many programmers have limited effectiveness because they don't have a deep understanding of how their computer actually works under the hood.Β  In Learn to Program with Assembly, you will learn to program in assembly language - the language of the computer itself.Β </div><div><br></div><div>Assem

Theoretical Foundations for Quantitative
✍ Gennady P Berman, Luca Spadafora πŸ“‚ Library πŸ“… 2017 πŸ› WSPC 🌐 English

This book provides simple introduction to quantitative finance for students and junior quants who want to approach the typical industry problems with practical but rigorous ambition. It shows a simple link between theoretical technicalities and practical solutions. Mathematical aspects are discussed