public class Swap extends AbstractAnalyticProduct implements AnalyticProductInterface
TimeDiscretizationInterface.
The swap is just the composition of two SwapLegs, namely the
receiver leg and the payer leg. The value of the swap is the value of the receiver leg minus the value of the payer leg.| Constructor and Description |
|---|
Swap(AnalyticProductInterface legReceiver,
AnalyticProductInterface legPayer)
Create a swap which values as
legReceiver - legPayer. |
Swap(ScheduleInterface scheduleReceiveLeg,
double spreadReceive,
String discountCurveReceiveName,
ScheduleInterface schedulePayLeg,
String forwardCurvePayName,
String discountCurvePayName)
Creates a swap with notional exchange.
|
Swap(ScheduleInterface scheduleReceiveLeg,
String forwardCurveReceiveName,
double spreadReceive,
String discountCurveReceiveName,
ScheduleInterface schedulePayLeg,
String forwardCurvePayName,
double spreadPay,
String discountCurvePayName)
Creates a swap with notional exchange.
|
Swap(ScheduleInterface scheduleReceiveLeg,
String forwardCurveReceiveName,
double spreadReceive,
String discountCurveReceiveName,
ScheduleInterface schedulePayLeg,
String forwardCurvePayName,
double spreadPay,
String discountCurvePayName,
boolean isNotionalExchanged)
Creates a swap with notional exchange.
|
| Modifier and Type | Method and Description |
|---|---|
static double |
getForwardSwapRate(ScheduleInterface fixSchedule,
ScheduleInterface floatSchedule,
ForwardCurveInterface forwardCurve) |
static double |
getForwardSwapRate(ScheduleInterface fixSchedule,
ScheduleInterface floatSchedule,
ForwardCurveInterface forwardCurve,
AnalyticModelInterface model) |
static double |
getForwardSwapRate(TimeDiscretizationInterface fixTenor,
TimeDiscretizationInterface floatTenor,
ForwardCurveInterface forwardCurve) |
static double |
getForwardSwapRate(TimeDiscretizationInterface fixTenor,
TimeDiscretizationInterface floatTenor,
ForwardCurveInterface forwardCurve,
DiscountCurveInterface discountCurve) |
AnalyticProductInterface |
getLegPayer()
Return the payer leg of the swap, i.e. the leg who's value is subtracted from the swap value.
|
AnalyticProductInterface |
getLegReceiver()
Return the receiver leg of the swap, i.e. the leg who's value is added to the swap value.
|
double |
getValue(double evaluationTime,
AnalyticModelInterface model)
Return the valuation of the product using the given model.
|
String |
toString() |
getValue, getValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetValuepublic Swap(AnalyticProductInterface legReceiver, AnalyticProductInterface legPayer)
legReceiver - legPayer.legReceiver - The receiver leg.legPayer - The payler leg.public Swap(ScheduleInterface scheduleReceiveLeg, String forwardCurveReceiveName, double spreadReceive, String discountCurveReceiveName, ScheduleInterface schedulePayLeg, String forwardCurvePayName, double spreadPay, String discountCurvePayName, boolean isNotionalExchanged)
scheduleReceiveLeg - Schedule of the receiver leg.forwardCurveReceiveName - Name of the forward curve, leave empty if this is a fix leg.spreadReceive - Fixed spread on the forward or fix rate.discountCurveReceiveName - Name of the discount curve for the receiver leg.schedulePayLeg - Schedule of the payer leg.forwardCurvePayName - Name of the forward curve, leave empty if this is a fix leg.spreadPay - Fixed spread on the forward or fix rate.discountCurvePayName - Name of the discount curve for the payer leg.isNotionalExchanged - If true, both leg will pay notional at the beginning of each swap period and receive notional at the end of the swap period. Note that the cash flow date for the notional is periodStart and periodEnd (not fixingDate and paymentDate).public Swap(ScheduleInterface scheduleReceiveLeg, String forwardCurveReceiveName, double spreadReceive, String discountCurveReceiveName, ScheduleInterface schedulePayLeg, String forwardCurvePayName, double spreadPay, String discountCurvePayName)
scheduleReceiveLeg - Schedule of the receiver leg.forwardCurveReceiveName - Name of the forward curve, leave empty if this is a fix leg.spreadReceive - Fixed spread on the forward or fix rate.discountCurveReceiveName - Name of the discount curve for the receiver leg.schedulePayLeg - Schedule of the payer leg.forwardCurvePayName - Name of the forward curve, leave empty if this is a fix leg.spreadPay - Fixed spread on the forward or fix rate.discountCurvePayName - Name of the discount curve for the payer leg.public Swap(ScheduleInterface scheduleReceiveLeg, double spreadReceive, String discountCurveReceiveName, ScheduleInterface schedulePayLeg, String forwardCurvePayName, String discountCurvePayName)
scheduleReceiveLeg - Schedule of the receiver leg.spreadReceive - Fixed spread on the forward or fix rate.discountCurveReceiveName - Name of the discount curve for the receiver leg.schedulePayLeg - Schedule of the payer leg.forwardCurvePayName - Name of the forward curve, leave empty if this is a fix leg.discountCurvePayName - Name of the discount curve for the payer leg.public double getValue(double evaluationTime,
AnalyticModelInterface model)
AnalyticProductInterfaceAnalyticModelInterface.getValue in interface AnalyticProductInterfaceevaluationTime - The evaluation time as double. Cash flows prior and including this time are not considered.model - The model under which the product is valued.public static double getForwardSwapRate(TimeDiscretizationInterface fixTenor, TimeDiscretizationInterface floatTenor, ForwardCurveInterface forwardCurve)
public static double getForwardSwapRate(TimeDiscretizationInterface fixTenor, TimeDiscretizationInterface floatTenor, ForwardCurveInterface forwardCurve, DiscountCurveInterface discountCurve)
public static double getForwardSwapRate(ScheduleInterface fixSchedule, ScheduleInterface floatSchedule, ForwardCurveInterface forwardCurve)
public static double getForwardSwapRate(ScheduleInterface fixSchedule, ScheduleInterface floatSchedule, ForwardCurveInterface forwardCurve, AnalyticModelInterface model)
public AnalyticProductInterface getLegReceiver()
public AnalyticProductInterface getLegPayer()
Copyright © 2017. All rights reserved.