In Computational Finance Using C and C# George Levy raises computational finance to the next level using the languages of both standard C and C#. The inclusion of both these languages enables readers to match their use of the book to their firms internal software and code requirements. Levy also provides derivatives pricing information for: equity derivates: vanilla options, quantos, generic equity basket options interest rate derivatives: FRAs, swaps, quantos foreign exchange derivatives: FX forwards, FX options credit derivatives: credit default swaps, defaultable bonds, total return swaps.
Computational Finance Using C and C# by George Levy is supported by extensive web resources. Available for purchase on the multi-tier website are e versions of this book and Levys first book, Computational Finance: Numerical Methods for Pricing Financial Derivatives. Purchasers of the print or e-book can download free software consisting of executable files, configuration files, and results files. With these files the user can run the example portfolio application in Chapter 8 and change the portfolio composition and the attributes of the deals.
In addition, Upgrade Software is available on the website for a small fee, and includes: Code to run all the C, C# and Excel examples in the book Complete C source code for the Analytics_Mathlib maths library that is used in the book C# source code, market data and portfolio files for the portfolio application described in Chapter 8
All the C/C# software can be compiled using either Visual Studio .NET 2005, or the freely available Microsoft Visual C#/C++ 2005 Express Editions.
With this software, the user can open the files and create new deals, new instruments, and change the attributes of the deals by editing the code and recompiling it. This serves as a template that a user can run to customize the deals for their personal, everyday use.
* Complete financial instrument pricing code in standard C and C# available to book buyers on companion website * Illustrates the use of C# design patterns, including dictionaries, abstract classes, and .NET InteropServices.
Table of content:
1 Overview of financial derivatives 1 2 Introduction to stochastic processes 5 2.1 Brownian motion 5 2.2 A Brownian model of asset price movements 9 2.3 Ito’s formula (or lemma) 10 2.4 Girsanov’s theorem 12 2.5 Ito’s lemma for multiasset geometric Brownian motion 13 2.6 Ito product and quotient rules in two dimensions 15 2.7 Ito product in n dimensions 18 2.8 The Brownian bridge 19 2.9 Time-transformed Brownian motion 21 2.10 Ornstein–Uhlenbeck process 24 2.11 The Ornstein–Uhlenbeck bridge 27 2.12 Other useful results 31 2.13 Selected problems 33 3 Generation of random variates 37 3.1 Introduction 37 3.2 Pseudo-random and quasi-random sequences 38 3.3 Generation of multivariate distributions: independent variates 41 3.4 Generation of multivariate distributions: correlated variates 47 4 European options 59 4.1 Introduction 59 4.2 Pricing derivatives using a martingale measure 59 4.3 Put call parity 60 4.4 Vanilla options and the Black–Scholes model 62 4.5 Barrier options 85 5 Single asset American options 97 5.1 Introduction 97 5.2 Approximations for vanilla American options 97 5.3 Lattice methods for vanilla options 114 5.4 Grid methods for vanilla options 135 5.5 Pricing American options using a stochastic lattice 172 Multiasset options 181 6.1 Introduction 181 6.2 The multiasset Black–Scholes equation 181 6.3 Multidimensional Monte Carlo methods 183 6.4 Introduction to multidimensional lattice methods 185 6.5 Two asset options 190 6.6 Three asset options 201 6.7 Four asset options 205 Other financial derivatives 209 7.1 Introduction 209 7.2 Interest rate derivatives 209 7.3 Foreign exchange derivatives 228 7.4 Credit derivatives 232 7.5 Equity derivatives 237 C# portfolio pricing application 245 8.1 Introduction 245 8.2 Storing and retrieving the market data 254 8.3 The PricingUtils class and the Analytics_MathLib 262 8.4 Equity deal classes 267 8.5 FX deal classes 280 pendix A: The Greeks for vanilla European options 289 A.1 Introduction 289 A.2 Gamma 290 A.3 Delta 291 A.4 Theta 292 A.5 Rho 293 A.6 Vega 294 pendix B: Barrier option integrals 295 B.1 The down and out call 295 B.2 The up and out call 298 Appendix C: Standard statistical results C.1 The law of large numbers C.2 The central limit theorem C.3 The variance and covariance of random variables C.4 Conditional mean and covariance of normal distribution C.5 Moment generating functions Appendix D: Statistical distribution functions 313 D.1 The normal (Gaussian) distribution 313 D.2 The lognormal distribution 315 D.3 The Student’s t distribution 317 D.4 The general error distribution 319 Appendix E: Mathematical reference 321 E.1 Standard integrals 321 E.2 Gamma function 321 E.3 The cumulative normal distribution function 322 E.4 Arithmetic and geometric progressions 323 Appendix F: Black–Scholes finite-difference schemes 325 F.1 The general case 325 F.2 The log transformation and a uniform grid 325 Appendix G: The Brownian bridge: alternative derivation 329 Appendix H: Brownian motion: more results 333 H.1 Some results concerning Brownian motion 333 H.2 Proof of Eq. (H.1.2) 334 H.3 Proof of Eq. (H.1.4) 335 H.4 Proof of Eq. (H.1.5) 335 H.5 Proof of Eq. (H.1.6) 335 H.6 Proof of Eq. (H.1.7) 338 H.7 Proof of Eq. (H.1.8) 338 H.8 Proof of Eq. (H.1.9) 338 H.9 Proof of Eq. (H.1.10) 339 Appendix I : The Feynman–Kac formula 341 Appendix J: Answers to problems 343 J.1 Problem 1 343 J.2 Problem 2 344 J.3 Problem 3 345 J.4 Problem 4 346 J.5 Problem 5 346 J.6 Problem 6 347 J.7 Problem 7 348 J.8 Problem 8 350 J.9 Problem 9 350 J.10 Problem 10 352 J.11 Problem 11 354 Index 361