fixed fixed x ccy swap
financepy.products.rates.swaps.fixed_fixed_x_ccy_swap
Class
FixedFixedXCcySwap
FixedFixedXCcySwap(
effective_dt: Date,
term_dt_or_tenor: Date | str,
fixed_leg_type: SwapTypes,
fixed_cpn: float,
fixed_freq_type: FrequencyTypes,
fixed_dc_type: DayCountTypes,
float_spread: float = 0.0,
float_freq_type: FrequencyTypes = <FrequencyTypes.QUARTERLY: 4>,
float_dc_type: DayCountTypes = <DayCountTypes.THIRTY_E_360: 2>,
notional: float = 1000000,
cal_type: CalendarTypes | list | tuple = <CalendarTypes.WEEKEND: 2>,
bd_type: BusDayAdjustTypes = <BusDayAdjustTypes.FOLLOWING: 2>,
dg_type: DateGenRuleTypes = <DateGenRuleTypes.BACKWARD: 2>,
)
Class for managing a cross currency swap contract. This is a contract
in which a fixed or floating payment leg in one currency is exchanged for a
series of fixed or floating rates in a second currency. There is an
exchange of par. The contract is entered into at zero initial cost and it
lasts from a start date to a specified maturity date.
The value of the contract is the NPV of the two cpn streams. Discounting
is done on a supplied discount discount (one for each leg) is separate
from the curve from which the implied index rates are extracted.
Methods
value
value(
self,
value_dt,
discount_curve,
index_curve,
first_fixing_rate = None,
principal = 0.0,
)
Value the interest rate swap on a value date given a single Ibor
discount curve.
fixed_dts
fixed_dts(
self,
)
return a vector of the fixed leg payment dates
float_dts
float_dts(
self,
)
return a vector of the fixed leg payment dates
pv01
pv01(
self,
value_dt,
discount_curve,
)
Calculate the value of 1 basis point cpn on the fixed leg.
swap_rate
swap_rate(
self,
value_dt,
discount_curve,
)
Calculate the fixed leg cpn that makes the swap worth zero.
If the valuation date is before the swap payments start then this
is the forward swap rate as it starts in the future. The swap rate
is then a forward swap rate and so we use a forward discount
factor. If the swap fixed leg has begun then we have a spot
starting swap.
fixed_leg_value
fixed_leg_value(
self,
value_dt,
discount_curve,
principal = 0.0,
)
Calculate the present value of the fixed leg cash flows.
cash_settled_pv01
cash_settled_pv01(
self,
value_dt,
flat_swap_rate,
freq_type,
)
Calculate the forward value of an annuity of a forward starting
swap using a single flat discount rate equal to the swap rate. This is
used in the pricing of a cash-settled swaption in the IborSwaption
class. This method does not affect the standard valuation methods.
float_leg_value
float_leg_value(
self,
value_dt,
discount_curve,
index_curve,
first_fixing_rate = None,
principal = 0.0,
)
Value the floating leg with payments from an index curve and
discounting based on a supplied discount curve. The valuation date can
be the today date. In this case the price of the floating leg will not
be par (assuming we added on a principal repayment). This is only the
case if we set the valuation date to be the swap's actual settlement
date.
print_fixed_leg_pv
print_fixed_leg_pv(
self,
)
Prints the fixed leg dates, accrual factors, discount factors,
cash amounts, their present value and their cumulative PV using the
last valuation performed.
print_fixed_leg_flows
print_fixed_leg_flows(
self,
)
Prints the fixed leg amounts without any valuation details. Shows
the dates and sizes of the promised fixed leg flows.
print_float_leg_pv
print_float_leg_pv(
self,
)
Prints the floating leg dates, accrual factors, discount factors,
forward libor rates, implied cash amounts, their present value and
their cumulative PV using the last valuation performed.
Generated automatically from the FinancePy source code.
Do not edit this file manually.