Binomial Method, Design Patterns and Excel Output


In this chapter we design and implement a well-known application, namely the binomial method to price one-factor and two-factor options. The reasons for discussing this well-known case are:

  • We design and implement the method in C#, using its object-oriented features, support for generics and the use of .NET libraries. The reader can compare the proposed solution with solutions using VBA, C++ and pseudocode.
  • In contrast to a procedural or object-oriented design of the application we view it as being a special case or instance of a domain architecture (see Duffy 2004b). Realising this fact, we can then decompose the system into a set of loosely coupled subsystems, each of which has a well-defined interface. Having done so, we can then implement each subsystem using a combination of C# interfaces and classes.
  • We apply Design Patterns (GOF 1995) to promote the maintainability and flexibility of the application. For example, we use the Factory Method pattern to initialise the input to the binomial method and we use the Strategy pattern to compute certain parameters in the model.
  • The system design knowledge that we acquire in this chapter can be applied to other pricing applications. For example, we shall see in Chapter 10 that the system design for a PDE/FDM solver is similar to the one that we discuss in this chapter. In fact, both applications (binomial, PDE/FDM) are special cases of a domain architecture ...

Get C# for Financial Markets now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.