vignettes/basics.Rmd
basics.Rmd
Currencies, currency pairs and interest rate indices are key building blocks to a coherent financial mathematics library. As currencies are the basis for transactions, they bring together different conventions in a unique manner. Currency pairs are required to define the terms of FX transactions while interest rate indices define the payoffs of the largest over-the-counter derivatives asset class.
The fmbasics
package supplies implementations of the following key currencies: AUD
, EUR
, GBP
, JPY
, NZD
and USD
. The 2006 ISDA definitions map these currencies to financial centres for the purposes of determining whether banks and FX markets settle payments on a given date.
#> <Currency> AUD
#> [1] "AUD"
#> <JointCalendar> AUSY
#> TZ: Australia/Sydney
#> Join rule: all
You can create other currencies by calling Currency()
. However, you will need to define the currency’s associated fmdates::Calendar
first (along with its associated fmdates::is_good()
method).
It is also possible to create currency pairs and calculate value dates:
#> <CurrencyPair> AUDUSD
#> [1] "2014-04-16" NA
#> [1] "2014-04-22" "2014-04-23"
#> [1] "2014-04-23" "2014-04-24"
#> [1] "2014-04-17" "2014-04-22"
#> [1] "2014-07-22" "2014-07-23"
You can create other currency pairs by calling CurrencyPair()
:
#> <CurrencyPair> USDAUD
Interest rate indices are key to defining the payoffs on interest rate derivatives such as interest rate swaps, swaptions, etc. The fmbasics
package provides implementations of the most important indices for the currencies that it supports including “xIBOR” and “xONIA” indices such as USDLIBOR
and EONIA
.
#> <CashIndex> AONIA
#> <CashIndex> FedFunds
#> <IborIndex> 3m AUD BBSW
#> <IborIndex> 3m USD LIBOR
You can use determine key dates associated with these indices relative to supplied dates such as the reset dates, value date and maturity date:
#> [1] "2017-01-03" "2017-01-04" "2017-01-05"
#> [1] "2017-01-09" "2017-01-10" "2017-01-10"
#> [1] "2017-04-05" "2017-04-06" "2017-04-07"