
P1: JYS
c07 JWBK378-Fletcher April 24, 2009 8:16 Printer: Yet to come
7
Timeline: Events and Controller
In the preceding chapter we looked at trade representation. This chapter covers a number of
concepts that provide the glue between the trade representation and the pricing models. We
will first discuss the concept of an event. Once we have a firm understanding of an event we
will move onto the timeline, which is essentially a convenient container for a sequence of
events. We finish the chapter by reviewing the idea of a controller. Of all the classes discussed
in this chapter, the controller is the conduit through which pricing models communicate with
the trade representation.
7.1 EVENTS
A fundamental concept of any pricing analytics is that of an event. So what does an event
represent? In essence an event represents either a cash flow depending on some piece of
financial information, such as a foreign exchange rate on a particular date for example, or
an exercise decision. The module ppf.core.event, as outlined below, contains two core
classes: pay
event and exercise event. The class pay event is constructed from a
flow, a pay or receive flag, a leg id, and a reset id. The leg id enables clients to determine which
leg of the trade the flow belongs to and the reset id informs clients which observable of the
flow is represented by the event. The class exercise
event is constructed from an exercise
and a