swapIRS: 'swapIRS'

Description Usage Arguments Value Author(s) Examples

View source: R/swapIRS.R

Description

Commodity swap pricing from exchange settlement

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
swapIRS(
  trade.date = lubridate::today(),
  eff.date = lubridate::today() + 2,
  mat.date = lubridate::today() + 2 + lubridate::years(2),
  notional = 1e+06,
  PayRec = "Rec",
  fixed.rate = 0.05,
  float.curve = usSwapCurves,
  reset.freq = 3,
  disc.curve = usSwapCurves,
  convention = c("act", 360),
  bus.calendar = "NY",
  output = "price"
)

Arguments

trade.date

Date object. Defaults to today().

eff.date

Date object. Defaults to today() + 2 days.

mat.date

Date object. Defaults to today() + 2 years.

notional

Numeric value of notional. Defaults to 1,000,000.

PayRec

"Pay" or "Rec" fixed.

fixed.rate

Numeric fixed interest rate. Defaults to 0.05.

float.curve

List of interest rate curves. Defaults to data("usSwapCurves").

reset.freq

Numeric where 1 = "monthly", 3 = quarterly, 6 = Semi annual 12 = yearly.

disc.curve

List of interest rate curves. Defaults to data("usSwapCurves").

convention

Vector of convention e.g. c("act",360) c(30,360),...

bus.calendar

Banking day calendar. Not implemented.

output

"price" for swap price or "all" for price, cash flow data frame, duration.

Value

List of swap price, cash flow data frame, duration.

Author(s)

Philippe Cote

Examples

1
2
3
4
5
6
data("usSwapCurves")
swapIRS(trade.date = as.Date("2020-01-04"), eff.date = as.Date("2020-01-06"),
mat.date = as.Date("2022-01-06"), notional = 1000000,
PayRec = "Rec", fixed.rate=0.05, float.curve = usSwapCurves, reset.freq=3,
disc.curve = usSwapCurves, convention = c("act",360),
bus.calendar = "NY", output = "all")

RTL documentation built on June 12, 2021, 5:06 p.m.

Related to swapIRS in RTL...