You are previewing How to Implement Market Models Using VBA.
O'Reilly logo
How to Implement Market Models Using VBA

Book Description

Accessible VBA coding for complex financial modelling

How to Implement Market Models Using VBA makes solving complex valuation issues accessible to any financial professional with a taste for mathematics. With a focus on the clarity of code, this practical introductory guide includes chapters on VBA fundamentals and essential mathematical techniques, helping readers master the numerical methods to build an algorithm that can be used in a wide range of pricing problems. Coverage includes general algorithms, vanilla instruments, multi-asset instruments, yield curve models, interest rate exotics, and more, guiding readers thoroughly through pricing in the capital markets area. The companion website (http://implementmodinvba.com/) features additional VBA code and algorithmic techniques, and the interactive blog provides a forum for discussion of code with programmers and financial engineers, giving readers insight into the different applications and customisations possible for even more advanced problem solving..

Financial engineers implement models from a mathematical representation of an asset's performance by building a program that performs a valuation of securities based on this asset. How to Implement Market Models Using VBA makes this technical process understandable, with well-explained algorithms, VBA code, and accessible theoretical explanations.

  • Decide which numerical method to use in which scenario

  • Identify the necessary building blocks of an algorithm

  • Write clear, functional VBA code for a variety of problems

  • Apply algorithms to different instruments and models

  • Designed for finance professionals, this book brings more accurate modelling within reach for anyone with interest in the market. For clearer code, patient explanation, and practical instruction, How to Implement Market Models Using VBA is an essential introductory guide.

    Table of Contents

    1. Cover Page
    2. Title Page
    3. Copyright
    4. Contents
    5. Preface
    6. Acknowledgements
    7. Abbreviations
    8. About the Author
    9. CHAPTER 1: The Basics of VBA Programming
      1. 1.1 Getting started
      2. 1.2 VBA objects and syntax
        1. 1.2.1 The object-oriented basic syntax
        2. 1.2.2 Using objects
      3. 1.3 Variables
        1. 1.3.1 Variable declaration
        2. 1.3.2 Some usual objects
        3. 1.3.3 Arrays
      4. 1.4 Arithmetic
      5. 1.5 Subroutines and functions
        1. 1.5.1 Subroutines
        2. 1.5.2 Functions
        3. 1.5.3 Operations on one-dimensional arrays
        4. 1.5.4 Operations on two-dimensional arrays (matrices)
        5. 1.5.5 Operations with dates
      6. 1.6 Custom objects
        1. 1.6.1 Types
        2. 1.6.2 Classes
      7. 1.7 Debugging
        1. 1.7.1 Error handling
        2. 1.7.2 Tracking the code execution
    10. CHAPTER 2: Mathematical Algorithms
      1. 2.1 Introduction
      2. 2.2 Sorting lists
        1. 2.2.1 Shell sort
        2. 2.2.2 Quick sort
      3. 2.3 Implicit equations
      4. 2.4 Search for extrema
        1. 2.4.1 The Nelder-Mead algorithm
        2. 2.4.2 The simulated annealing
      5. 2.5 Linear algebra
        1. 2.5.1 Matrix inversion
        2. 2.5.2 Cholesky decomposition
        3. 2.5.3 Interpolation
        4. 2.5.4 Integration
        5. 2.5.5 Principal Component Analysis
    11. CHAPTER 3: Vanilla Instruments
      1. 3.1 Definitions
      2. 3.2 Fixed income
        1. 3.2.1 Bond market
        2. 3.2.2 Interbank market
      3. 3.3 Vanilla derivatives
        1. 3.3.1 Forward contracts
        2. 3.3.2 Swaps
        3. 3.3.3 Bond futures
      4. 3.4 Options basics
        1. 3.4.1 Brownian motion
        2. 3.4.2 Ito integral
        3. 3.4.3 Ito formula
        4. 3.4.4 Black–Scholes basic model
        5. 3.4.5 Risk-neutral probability
        6. 3.4.6 Change of probability
        7. 3.4.7 Martingale and numeraires
        8. 3.4.8 European-style options pricing
      5. 3.5 First generation exotic options
        1. 3.5.1 Barrier options
        2. 3.5.2 Quanto options
    12. CHAPTER 4: Numerical Solutions
      1. 4.1 Finite differences
        1. 4.1.1 Generic equation
        2. 4.1.2 Implementation
      2. 4.2 Trees
        1. 4.2.1 Binomial trees
        2. 4.2.2 Trinomial trees
      3. 4.3 Monte-Carlo scenarios
        1. 4.3.1 Uniform number generator
        2. 4.3.2 From uniform to Gaussian numbers
      4. 4.4 Simulation and regression
      5. 4.5 Double-barrier analytical approximation
    13. CHAPTER 5: Monte-Carlo Pricing Issues
      1. 5.1 Multi-asset simulation
        1. 5.1.1 The correlations issue
        2. 5.1.2 The Gaussian case
        3. 5.1.3 Exotics
      2. 5.2 Discretization schemes
      3. 5.3 Variance reduction techniques
        1. 5.3.1 Antithetic variates
        2. 5.3.2 Importance sampling
        3. 5.3.3 Control variates
    14. CHAPTER 6: Yield Curve Models
      1. 6.1 Short rate models
        1. 6.1.1 Introduction
        2. 6.1.2 Hull and White one-factor model
        3. 6.1.3 Gaussian two-factor model
        4. 6.1.4 Hull and White two-factor model
      2. 6.2 Forward rate models
        1. 6.2.1 Generic Heath-Jarrow-Morton
        2. 6.2.2 LMM (LIBOR market model)
    15. CHAPTER 7: Stochastic Volatilities
      1. 7.1 The Heston model
        1. 7.1.1 Code
        2. 7.1.2 A faster algorithm
        3. 7.1.3 Calibration
      2. 7.2 Barrier options
        1. 7.2.1 Numerical results
        2. 7.2.2 Code
      3. 7.3 Asian-style options
      4. 7.4 SABR model
        1. 7.4.1 Caplets
        2. 7.4.2 Code
    16. CHAPTER 8: Interest Rate Exotics
      1. 8.1 CMS swaps
        1. 8.1.1 Code
      2. 8.2 Cancelable swaps
        1. 8.2.1 Code
        2. 8.2.2 Tree approximation
      3. 8.3 Target redemption note
        1. 8.3.1 Code
    17. Bibliography
    18. Index