In this post we will close the trilogy on (old style) swap pricing. In particular, we will look at how downloading the data for the variable rate needed to calculate the variable leg accrual. Part 1 gave the general idea behind tidy pricing interest rate swaps using a 7 lines pipe Part 2 went much more into detail and priced some real world contract comparing the results obtained vs Bloomberg and showing significantly good results.
Introduction I am a big passionate of the tidyverse packages: I think they make the code very clean and clear. In particular, I like the lubridate packages for managing and making operations with dates but its major drawback is that it doesn’t manage financial holidays, which are key when projecting financial cashflows linked to instruments like interest rte swaps. In this case, I prefer to use the RQuantLib package.