public final class SwaptionExercise extends Object implements org.joda.beans.ImmutableBean, Serializable
A swaption can have three different kinds of exercise - European, American and Bermudan. A European swaption has one exercise date, an American can exercise on any date, and a Bermudan can exercise on a fixed set of dates.
| Modifier and Type | Class and Description |
|---|---|
static class |
SwaptionExercise.Meta
The meta-bean for
SwaptionExercise. |
| Modifier and Type | Method and Description |
|---|---|
AdjustableDates |
calculateDates()
Gets the calculated list of exercise dates.
|
boolean |
equals(Object obj) |
AdjustableDates |
getDateDefinition()
Gets an explicit list of exercise dates.
|
Optional<Frequency> |
getFrequency()
Gets the frequency of exercise between the earliest and latest dates.
|
DaysAdjustment |
getSwapStartDateOffset()
Gets the offset to the swap start date.
|
int |
hashCode() |
boolean |
isAmerican()
Checks if the exercise is American.
|
boolean |
isBermudan()
Checks if the exercise is Bermudan.
|
boolean |
isEuropean()
Checks if the exercise is European.
|
static SwaptionExercise.Meta |
meta()
The meta-bean for
SwaptionExercise. |
SwaptionExercise.Meta |
metaBean() |
static SwaptionExercise |
ofAmerican(LocalDate earliestExerciseDate,
LocalDate latestExerciseDate,
BusinessDayAdjustment dateAdjustment,
DaysAdjustment swapStartDateOffset)
Obtains an instance for an American swaption.
|
static SwaptionExercise |
ofBermudan(AdjustableDates exerciseDates,
DaysAdjustment swapStartDateOffset)
Obtains an instance for a Bermudan swaption.
|
static SwaptionExercise |
ofBermudan(LocalDate earliestExerciseDate,
LocalDate latestExerciseDate,
BusinessDayAdjustment dateAdjustment,
Frequency frequency,
DaysAdjustment swapStartDateOffset)
Obtains an instance for a Bermudan swaption where the dates are calculated.
|
static SwaptionExercise |
ofEuropean(AdjustableDate exerciseDate,
DaysAdjustment swapStartDateOffset)
Obtains an instance for a European swaption.
|
AdjustableDate |
selectDate(LocalDate proposedExerciseDate,
ReferenceData refData)
Selects a single exercise date based on the proposed date.
|
String |
toString() |
public static SwaptionExercise ofEuropean(AdjustableDate exerciseDate, DaysAdjustment swapStartDateOffset)
exerciseDate - the exercise dateswapStartDateOffset - the swap start date offsetpublic static SwaptionExercise ofAmerican(LocalDate earliestExerciseDate, LocalDate latestExerciseDate, BusinessDayAdjustment dateAdjustment, DaysAdjustment swapStartDateOffset)
earliestExerciseDate - the earliest exercise datelatestExerciseDate - the latest exercise datedateAdjustment - the date adjustmentswapStartDateOffset - the swap start date offsetpublic static SwaptionExercise ofBermudan(AdjustableDates exerciseDates, DaysAdjustment swapStartDateOffset)
exerciseDates - the exercise datesswapStartDateOffset - the swap start date offsetpublic static SwaptionExercise ofBermudan(LocalDate earliestExerciseDate, LocalDate latestExerciseDate, BusinessDayAdjustment dateAdjustment, Frequency frequency, DaysAdjustment swapStartDateOffset)
For example, if the dates represent a 5 year period and the frequency is yearly then the Bermudan swaption can be exercised each year in the period. The exact dates are calculated by adding multiples of the frequency to the earliest date.
earliestExerciseDate - the earliest exercise datelatestExerciseDate - the latest exercise datedateAdjustment - the date adjustmentfrequency - the frequencyswapStartDateOffset - the swap start date offsetpublic boolean isEuropean()
public boolean isAmerican()
public boolean isBermudan()
public AdjustableDates calculateDates()
This could be a large list in the case of an American exercise.
public AdjustableDate selectDate(LocalDate proposedExerciseDate, ReferenceData refData)
This validates the proposed exercise date and returns it.
The date is matched as an adjusted date first, then as an unadjusted date.
If the date can only be an adjusted date, the result will use BusinessDayAdjustment.NONE.
proposedExerciseDate - the proposed exercise daterefData - the reference dataIllegalArgumentException - if the proposed exercise date is not validpublic static SwaptionExercise.Meta meta()
SwaptionExercise.public SwaptionExercise.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic AdjustableDates getDateDefinition()
A European swaption has one date in the list. A Bermudan swaption has at least two dates in the list. An American swaption has at exactly two dates in the list, the earliest and latest dates.
public Optional<Frequency> getFrequency()
An American swaption must set this to one day.
A Bermudan swaption might set this to a specific frequency instead of pre-calculating the dates. If it does this, there must only be two dates in the list. The intermediate dates will be calculated by adding multiples of the frequency to the earliest date.
public DaysAdjustment getSwapStartDateOffset()
Each adjusted exercise date has this offset applied to get the start date of the underlying swap.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.