FE 587 C/C++ Programming for FE

The new homepage for 2011 is here

Fall 2010

Instructor: Ali Taylan Cemgil
Bogaziçi University, Department of Computer Engineering, Istanbul, Turkey

Material

Here, you can find example programs we wrote during the class.

Course Description

In recent years, quantitative analysis depends increasingly on computation. The use of computers became essential in carrying out complex financial decisions and handling vast amounts of financial data available. For such complex information processing tasks, institutions need to develop their own proprietary software. Yet, such software is very rarely rewritten from scratch; rather it is built using existing components and continually adapted to changing requirements. To be competitive, a financial engineer must be sufficiently literate in computer code and software engineering concepts: he/she must be able to understand, test, maintain and alter written code, and develop new applications based on reusable and flexible libraries.

The primary goal of this course is to provide a self contained introduction to computer programming using C/C++. Our focus will be on algorithmic aspects of computer applications currently used primarily in the financial industry, and to prepare the student for the development of new applications. Our treatment will be exclusively based on case studies and examples: after introducing a programming concept, its use will be illustrated in an example relevant for financial computation.

The student will be introduced to C/C++ programming language and an integrated development environment. The requirement will be a weekly homework that will involve writing C++ code, and the final project will also involve programming in the same environment.

After succesful completion of the course, the students will

Topics

LectureTopic
1 Introduction to computers, programming and algorithms
2 Introduction to C/C++ Integrated Development Environments (IDE): Eclipse + MinGW tools
3 Basic I/O, variables, simple arithmetics, conditional statements
4 Loops and functions, Scope, header files, break, continue, Exception handling,
5 Function variables: scope, visibility and lifetime Call by value/call by reference
6 Arrays, strings and pointers Static versus dynamic memory allocation, multidimensional arrays
7 Introduction to object oriented programming (OOP) Taxonomies, inheritance, modularity and reusability
8 Introduction to advanced data structures and classes methods and attributes, public, private and protected, This pointer,
9 Principles of object oriented programming Polymorphism, virtual methods, friends.
10 Templates, Introduction to Standard Template Library
11 File structures, File I/O, fstream, read, write, close

(Tentative) Programming Examples and Exercises


Options and derivative pricing:
Black-Scholes framework; Binomial tree option pricing: 2-phase forward-backward time-stepping; impact of early exercise
random number generation;Box-Muller technique for generating normal variables;
Calculation of expectation values via Monte Carlo techniques; Rejection and Importance Sampling;
Simulation of normal and lognormal stochastic processes
Recursive estimation of time series; The Kalman filter and smoother
Stochastic Volatility; estimation via Sequential Monte Carlo

Programming Environment

A C++ Programming environment is required for the course. Depending on the platform, there are several alternatives:

Mac OS X

  1. Eclipse IDE + GNU c/c++ compilers (gcc and g++)
  2. XCode

Linux

  1. Eclipse IDE + Native gnu c/c++ compilers (gcc and g++)

Windows

  1. Eclipse IDE + MinGW
    Download and install MinGW toolset by clicking here
    Download and install Eclipse IDE for C/C++ Developers by clicking here
  2. Microsoft Visual C++ Express. This is a FREE C++ environment available for download from Microsoft. To download and install click here
Eclipse is an open source IDE, whose projects are focused on building an open development platform comprised of extensible frameworks and tools for building, deploying and managing software across the lifecycle. It is developed by the independent Eclipse foundation, with several corporate sponsors from the industry (such as IBM, Amazon, Cisco, Google). The Eclipse Foundation is a not-for-profit, member supported corporation that hosts the Eclipse projects: To read further, see http://www.eclipse.org. The fact that Eclipse runs on all platforms makes it very attractive.

MinGW (Minimalist GNU for Windows) is a native software port of the GNU Compiler Collection (GCC) and GNU Binutils for use in the development of native Microsoft Windows applications. To download and install MinGW click here

The instructor will be using the Eclipse environment with the MinGW toolset (GNU compilers gcc/g++) for his in-class examples. Use of GNU tools and the eclipse environment provides the widest flexibility and guarantees maximum cross platform portability (Mac, Linux and Windows).


Last Updated: 30 Jun 2010, © A. Taylan Cemgil, 2010