
- 354 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
About this book
Quantitative Finance: An Object-Oriented Approach in C++ provides readers with a foundation in the key methods and models of quantitative finance. Keeping the material as self-contained as possible, the author introduces computational finance with a focus on practical implementation in C++.
Through an approach based on C++ classes and templates, the text highlights the basic principles common to various methods and models while the algorithmic implementation guides readers to a more thorough, hands-on understanding. By moving beyond a purely theoretical treatment to the actual implementation of the models using C++, readers greatly enhance their career opportunities in the field.
The book also helps readers implement models in a trading or research environment. It presents recipes and extensible code building blocks for some of the most widespread methods in risk management and option pricing.
Web ResourceThe author's website provides fully functional C++ code, including additional C++ source files and examples. Although the code is used to illustrate concepts (not as a finished software product), it nevertheless compiles, runs, and deals with full, rather than toy, problems. The website also includes a suite of practical exercises for each chapter covering a range of difficulty levels and problem complexity.
Frequently asked questions
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Information
CHAPTER 1
A brief review of the C++ programming language
http://www.schlogl.com/QF.1.1 Getting started
cout ≪ "Hello World!" ≪ endl;
"Hello World!" to the standard output stream cout , followed by an end–of–line marker endl . A C++ program statement ends with a semicolon.int main (int argc, char *argv[])/* and */ (i.e. multiline comments) are also ignored.2"Hello World!" to the standard /** \file Hello.cpp \brief "Hello world!" program. */ #include <cstdlib< #include <iostream> using namespace std; int main(int argc, char .argv[]) { // Display "Hello World!" message cout ≪ "Hello World!" ≪ endl; return EXIT_SUCCESS; } iostream. The preprocessor directive#include <iostream>
iostream as if it were inserted into the source code at this location. All the required definitions (of cout, endl and the stream operator ≪) are found in this header file.3 Any functionality used in a particular C++ source code file must either be defined within that file, or its definition included via a header file. Different parts of the Standard Library require the use of different header files, and producing a custom C++ library, as we will proceed to do in the course of this book, requires creating C++ header files declaring functionality, as well as C++ source code files implementing it. /** \file Declare.cpp \brief Example program for variable declarations. Copyright 2005 by Erik Schloegl */ #include <cstdlib> #include <iostream> using namespace std; int main(int argc, char .argv[]) { int i = −3; cout ≪ "An integer: " ≪ i ≪ endl; double x = 3.5; cout ≪ "A double precision floating point number: "; cout ≪ x ≪ endl; bool b = true; cout ≪ "A Boolean value: " ≪ b ≪ endl; char c = ’$’; cout ≪ "A character: " ≪ c ≪ endl; return EXIT_SUCCESS; } 1.2 Procedural programming in C++
1.2.1 Built-in data types and the definition and declaration of variables
- Integers, declared as
int. - Floating point numbers, declared as
floatordouble(these days, most programs usedouble). - Booleans (variables which can hold the value
trueorfalse), declared asbool. - Characters, declared as
char.
unsigned (for non-negative integer variables) and long or short. Variables declared as long or short may represent a greater or smaller range of possible integers, but the actual implementation is machine and/or compiler dependent (See Stroustrup (1997)).doublefe x;
x to be a reference to a variable of type double. Thus the following statementsdouble y = 0.0; double& x = y; x = 1.0; cout ≪ y ≪ endl;
& in the declaration of x would result in 0 being displayed. The statementdouble* p;
p to be a pointer variable to hold the address of a double. The ampersand operator can be used to determine the pointer to an existing variable. Conversely, a pointer is de-referenced (i.e. the contents of the memory to which it points is accessed) using the operator *. Thusdouble y = 0.0; double* x = &y; *x = 1.0; cout ≪ y ≪ endl;
int integer_array[5];
[ ], e.g.int integer_array[5];
integer_array[0]. The variable integer_array itself is a pointer to the first element in the array; thusint integer_array[5]; int* p = integer_array; p[0] = 105; cout ≪ integer_array[0] ≪ endl;
new operator (see Section 1.2.5). However, the object–oriented features of C++ allow such dynamic memory allocation to be encapsulated in utility classes,5 e.g. for vectors and matrices, obviating the need to worry about these issues when writing higher level programs. Constants can be declared using the qualifier const , e.g.const int one = 1;
enum , e.g. enum currency {USD, EUR, JPY, AUD}; currency, which may take the values USD , EUR , JPY or AUD (defined by default to be represented as integers 0, 1, 2, 36). We can then declare a variable domestic to be of type currency and initi...Table of contents
- Cover
- Half Title
- Title Page
- Copyright Page
- Dedication Page
- Contents
- Preface
- Acknowledgements
- 1 A brief review of the C++ programming language
- 2 Basic building blocks
- 3 Lattice models for option pricing
- 4 The Black/Scholes world
- 5 Finite difference methods for partial differential equations
- 6 Implied volatility and volatility smiles
- 7 Monte Carlo simulation
- 8 The Heath/Jarrow/Morton model
- A Interfacing between C++ and Microsoft Excel
- B Automatic generation of documentation using Doxygen
- References
- Index