Self-Paced Advanced C++ Design and Implementation in Quantitative Finance by Nick Webber

Self-Paced Advanced C++ Design and Implementation in Quantitative Finance by Nick Webber

  • Self-Paced Course
  • Location: Globally online
  • This course can be included as part of the Annual Subscription Service.
  • This course be taken In House


The aim of the programme is to teach delegates the principles and concepts of OOP C++,  enabling them to understand the fundamentals of application design in OOP C++

The course uses concepts of application design to structure the presentation of C++ and numerical material.  As new ideas are introduced their realizations in C++ are presented in the context of applications of simulation and lattice methods to models of option pricing. The simulation method is developed from a naive monolithic single procedure main to a powerful fully polymorphic application. The final application, employing a variety of important design patterns including a polymorphic factory,  uses most of the syntactical elements of C++ in standard design paradigms. During this development a lattice method is implemented,  enabling further features to be introduced.

A basic knowledge of C++ is assumed.  A knowledge of classes is not assumed, nor a knowledge of object oriented programming styles. Implementations are in DevCpp, a freeware IDE wrapping the C++ 03 standard compliant GCC 3.4.2 compiler. C++ 11 extensions to C++ 03 are not required.

Lecture 1. A  simple procedural Monte Carlo
This module takes as its starting point the construction a simple monolithic procedural implementation of a basic time-stepping Monte Carlo method of option valuation.

Topics:  file layout and coding standards;  encapsulation into functions;  separation in translation units;  the (mis)use of static variables;  syntactic speed-ups and pre-computing;  the cost of exp().

Lecture 2. Introducing objects:  basic syntax and design
The procedural application of module 1 is converted into an application with functionality split between objects.  Constructs option,  process and accumulator objects.

Topics:  Class declaration and definition;  constructors/destructors; public and private functions and data;  forward declarations and decoupling; initializer lists;  identifying objects in the Monte Carlo application; encapsulation and decoupling in the MC application;  telepathy and avoiding it;  pointers to objects;  memory handling.

Lecture 3. Developing the basic structure
The basic objects in the module 2 are refined and developed by introducing I/O objects,  a stopwatch, an application wrapper object,  and a valuation object.  A path,  coded as a std∷vector,  is introduced.

Topics:  std∷vector;  object interaction (dispatching);  exception handling.

Lecture 4. Introducing polymorphism:  basic syntax
In the application developed in module 2 it is awkward to value different options.  Module 3 introduces and implements polymorphism.  It constructs polymorphic option,  process and application objects.  The concept of a pseudo-factory,  encapsulating object creation,  is introduced and implemented.

Topics: polymorphism and base classes;  pure virtual functions,  inheritance,  and interfaces;  the this pointer;  double dispatching;  output registration with std∷map;  the decorator pattern with Monte Carlo.

Lecture 5. A lattice application
A basic procedural lattice method is constructed.  The objects that support it are identified and integrated into the application developed in module 4.  The module 5 application can value American and Bermudan style options,  with the lattice,  and European style options,  with simulation.

Topics:  slices and extending the design of the option,  process and valuation objects;  whether to use composition or inheritance;  the pimple pattern.

Lecture 6. Advanced topics in class design
Motivated by the inconvenience of zero-based arrays and vectors in the lattice application this module develops a vector class that illustrates a number of advanced features of C++ object design.  In the module 6 application std∷vector is replaced by the new vector class.

Topics: deep and shallow copy;  the copy constructor and copy-assignment;  the  rule of three;  exception safety;  clone() and swap(); operator overloading;  friend methods.

Lecture 7. Polymorphic I/O
So far I/O has been comparatively crude.  Module 7 now addresses polymorphic I/O including I/O to and from file.  Objects request input using parameter classes.  A singleton IO object is introduced.  An environment object is created to manage I/O choice.

Topics:  streams;  opening modes;  methods and manipulators;  I/O to file;  random access files;  designing polymorphic input and output;   the singleton pattern.

Lecture 8. Generic programming and templates
This module provides background material required for the template factory described in module 10.  Template inputter functions are added to the model 7 application.

Topics:  templates,  declaration and definition;  the typename keyword; the inclusion model;  template member functions;  class templates;  non-member function templates;  full and partial specialization.

Lecture 9. Design patterns with objects
This module develops a non-template polymorphic application factory,  a precursor to the template factory developed in module 10.

Topics:  registration and call-back;  the factory pattern.

Lecture 10. A template factory
The non-template application factory of module 9 is converted in a full template factory.  Separate IO and environment factories are added.  The progress made since module 1 is assessed.

Topics:  mix-in classes;  traits;  printable objects;  the configuration object

CPD Certification

You will be able to receive up to 90 CPD points (30 hours of structured CPD and 60 hours of self-directed CPD) for completing this course.

The CPD Certification Service was established in 1996 as the independent CPD accreditation institution operating across industry sectors to complement the CPD policies of professional and academic bodies. The CPD Certification Service provides recognised independent CPD accreditation compatible with global CPD principles.