irs#
- swordfish.function.irs()#
The irs function prices an interest rate swap (IRS) for the floating-rate side.
An IRS is a derivative contract in which two parties agree to exchange one stream of interest payments for another over a set period of time. The most commonly traded IRS is the exchange of a fixed interest rate payment and a floating rate payment (typically benchmarked to an interbank offered rate LIBOR).
Note
Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.
- Parameters:
settlement (Constant) – A DATE scalar or vector indicating the settlement date.
resetInterval (Constant) – A DURATION scalar or vector indicating how often the interest rate is reset.
start (Constant) – A DATE scalar or vector indicating the start date.
maturity (Constant) – A DATE scalar or vector indicating the maturity date.
notional (Constant) – A numeric scalar or vector indicating the notional amount.
fixedRate (Constant) – A numeric scalar or vector indicating the fixed rate(s).
spread (Constant) – A numeric scalar or vector indicating the interest rate spread.
curve (Constant) – A dictionary scalar or vector indicating the fitted yield curve.
frequency (Constant) –
An INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:
0/”Once”: Bullet payment at maturity.
1/”Annual”: Annual payments.
2/”Semiannual”: Semi-annual payments.
4/”Quarterly”: Quarterly payments.
12/”Monthly”: Monthly payments.
calendar (Constant) – A STRING scalar or vector indicating the trading calendar(s). See Trading Calendar for more information.
convention (Constant, optional) –
A STRING scalar or vector indicating how cash flows that fall on a non-trading day are treated. The following options are available. Defaults to ‘ModifiedFollowing’.
’Following’: The following trading day.
’ModifiedFollowing’: The following trading day. If that day is in a different month, the preceding trading day is adopted instead.
’Preceding’: The preceding trading day.
’ModifiedPreceding’: The preceding trading day. If that day is in a different month, the following trading day is adopted instead.
’Unadjusted’: Unadjusted.
’HalfMonthModifiedFollowing’: The following trading day. If that day crosses the mid-month (15th) or the end of month, the preceding trading day is adopted instead.
’Nearest’: The nearest trading day. If both the preceding and following trading days are equally far away, default to following trading day.
rateType (Constant, optional) –
An INT/STRING scalar or vector indicating compound interest. It can be:
0/”CC” (default): continuous compounding
1/”C”: discrete compounding
- Returns:
A DOUBLE scalar or vector.
- Return type: