Learn how C++ is used in the development of solutions for options and derivatives trading in the financial industry. As an important part of the financial industry, options and derivatives trading has become increasingly sophisticated. Advanced trading techniques using financial derivatives have been used at banks, hedge funds, and pension funds. Because of stringent performance characteristics, most of these trading systems are developed using C++ as the main implementation language. Options and Derivatives Programming in C++ covers features that are frequently used to write financial software for options and derivatives, including the STL, templates, functional programming, and support for numerical libraries. New features introduced in the C++11 and C++14 standard are also covered: lambda functions, automatic type detection, custom literals, and improved initialization strategies for C++ objects. Readers will enjoy the how-to examples covering all the major tools and concepts used to build working solutions for quantitative finance. It includes advanced C++ concepts as well as the basic building libraries used by modern C++ developers, such as the STL and Boost, while also leveraging knowledge of object-oriented and template-based programming. Options and Derivatives Programming in C++ provides a great value for readers who are trying to use their current programming knowledge in order to become proficient in the style of programming used in large banks, hedge funds, and other investment institutions. The topics covered in the book are introduced in a logical and structured way and even novice programmers will be able to absorb the most important topics and competencies. What You Will Learn Grasp the fundamental problems in options and derivatives trading Converse intelligently about credit default swaps, Forex derivatives, and more Implement valuation models and trading strategies Build pricing algorithms around the Black-Sholes Model, and also using the Binomial and Differential Equations methods Run quantitative finance algorithms using linear algebra techniques Recognize and apply the most common design patterns used in options trading Save time by using the latest C++ features such as the STL and the Boost libraries Who This Book Is For Professional developers who have some experience with the C++ language and would like to leverage that knowledge into financial software development. This book is written with the goal of reaching readers who need a concise, algorithms-based book, providing basic information through well-targeted examples and ready to use solutions. Readers will be able to directly apply the concepts and sample code to some of the most common problems faced in the analysis of options and derivative contracts.
Author(s): CARLOS OLIVEIRA
Publisher: Apress
Year: 2016
Language: English
Pages: 260
Contents at a Glance
Contents
About the Author
About the Technical Reviewer
Introduction
Chapter 1: Options Concepts
Basic Definitions
Option Greeks
Using C++ for Options Programming
Availability
Performance
Standardization
Expressiveness
Modeling Options in C++
Creating Well-Behaving Classes
Computing Option Value at Expiration
Complete Listing
Building and Testing
Further References
Conclusion
Chapter 2: Financial Derivatives
Models for Derivative Pricing
Credit Default Swaps
Collateralized Debt Obligations
FX Derivatives
Derivative Modeling Equations
Numerical Models
Binomial Trees
Simulation Models
Using the STL
Generating a Random Walk
Complete Listing
Building and Testing
Further References
Conclusion
Chapter 3: Basic Algorithms
Date and Time Handling
Date Operations
Complete Listings
A Compact Date Representation
Complete Listings
Building and Testing
Working with Networks
Creating a Dictionary Class
Calculating a Shortest Path
Complete Listings
Building and Testing
Conclusion
Chapter 4: Object-Oriented Techniques
OO Programming Concepts
Encapsulation
Inheritance
Polymorphism
Polymorphism and Virtual Tables
Virtual Functions and Virtual Destructors
Abstract Functions
Building Class Hierarchies
Object Composition
Conclusion
Chapter 5: Design Patterns for Options Processing
Introduction to Design Patterns
The Factory Method Design Pattern
The Singleton Pattern
Clearing House Implementation in C++
The Observer Design Pattern
Complete Code
Conclusion
Chapter 6: Template-Based Techniques
Introduction to Templates
Compilation-Time Polymorphism
Template Functions
Implementing Recursive Functions
Recursive Functions and Template Classes
Containers and Smart Pointers
Avoiding Lengthy Template Instantiations
Pre-Instantiating Templates
Conclusion
Chapter 7: STL for Derivatives Programming
Introduction to Algorithms in the STL
Sorting
Presenting Frequency Data
Copying Container Data
Finding Elements
Selecting Option Data
Conclusion
Chapter 8: Functional Programming Techniques
Functional Programming Concepts
Function Objects
Functional Predicates in the STL
The Bind Function
Lambda Functions in C++11
Complete Code
Conclusion
Chapter 9: Linear Algebra Algorithms
Vector Operations
Scalar-to-Vector Operations
Vector-to-Vector Operations
Matrix Implementation
Using the uBLAS Library
Complete Code
Conclusion
Chapter 10: Algorithms for Numerical Analysis
Representing Mathematical Functions
Using Horner’s Method
Finding Roots of Equations
Newton’s Method
Integration
Conclusion
Chapter 11: Models Based on Differential Equations
General Differential Equations
Ordinary Differential Equations
Euler’s Method
Implementing the Method
The Runge-Kutta Method
Runge-Kutta Implementation
Complete Code
Conclusion
Chapter 12: Basic Models for Options Pricing
Lattice Models
Binomial Model
Binomial Model Implementation
Pricing American-Style Options
Solving the Black-Scholes Model
Numerical Solution of the Model
Complete Code
Conclusion
Chapter 13: Monte Carlo Methods
Introduction to Monte Carlo Methods
Random Number Generation
Probability Distributions
Using Common Probability Distributions
Creating Random Walks
Conclusion
Chapter 14: Using C++ Libraries for Finance
Boost Libraries
Installing Boost
Solving ODEs with Boost
Solving a Simple ODE
The QuantLib Library
Handling Dates
Working with Calendars
Computing Solutions for Black-Scholes Equations
Creating a C++ Interface
Complete Code
Conclusion
Chapter 15: Credit Derivatives
Introduction to Credit Derivatives
Modeling Credit Derivatives
Using Barrier Options
A Solver Class for Barrier Options
Barrier Option Classes in QuantLib
An Example Using QuantLib
Complete Code
Conclusion
Index