cds#
- swordfish.function.cds()#
Value a Credit Default Swap (CDS) contract.
- Parameters:
settlement (Constant) – A DATE scalar or vector indicating the settlement date.
maturity (Constant) – A DATE scalar or vector indicating the maturity date.
evalDate (Constant) – A DATE scalar or vector indicating the evaluation date of the CDS contract. Note that evalDate should be no later than settlement.
notional (Constant) – A non-negative numeric scalar or vector indicating the notional principal of the CDS contract.
spread (Constant) – A numeric scalar or vector indicating the CDS spread.
riskFree (Constant) – A numeric scalar or vector indicating the risk-free interest rate.
recovery (Constant) – A numeric scalar or vector in [0,1), indicating the recovery rate.
isSeller (Constant) – A BOOLEAN scalar or vector indicating whether the party is the buyer or the seller.
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).
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 ‘Following’.
’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.
termDateConvention (Constant, optional) – A STRING scalar or vector indicating how maturity date that falls on a non-trading day is treated. Parameter options and the default value are the same as convention.
rule (Constant, optional) –
A STRING scalar or vector indicating how the list of dates is generated. It can be:
’Backward’: Backward from maturity date to settlement date.
’Forward’: Forward from settlement date to maturity date.
’Zero’: No intermediate dates between settlement date and maturity date.
’ThirdWednesday’: All dates but settlement date and maturity date are taken to be on the third Wednesday of their month (with forward calculation).
’ThirdWednesdayInclusive’: All dates are taken to be on the third Wednesday of their month (with forward calculation).
’Twentieth’: All dates but the settlement date are taken to be the twentieth of their month (used for CDS schedules in emerging markets). The maturity date is also modified.
’TwentiethIMM’: All dates but the settlement date are taken to be the twentieth of an IMM (International Money Market) month(used for CDS schedules). The maturity date is also modified.
’OldCDS’: Same as TwentiethIMM with unrestricted date ends and long/short stub coupon period (old CDS convention).
’CDS’ (default): Credit derivatives standard rule defined in the “Big Bang” Protocol in 2009.
’CDS2015’: Ammended credit derivatives standard rule that took effect on December 20, 2015.
- Returns:
A DOUBLE scalar or vector.
- Return type: