<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: 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
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
- 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 - Some Mechanics of C++
ThevectorContainer
Setting and Accessing Elements of avector
Concluding Remarks on STLvectors
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 - 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 - 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 - 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
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
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
<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
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