public final class ImmutableFraConvention extends Object implements FraConvention, org.joda.beans.ImmutableBean, Serializable
This defines the market convention for a FRA against a particular index.
In most cases, the index contains sufficient information to fully define the convention.
As such, no other fields need to be specified when creating an instance.
The name of the convention is the same as the name of the index by default.
The getters will default any missing information on the fly, avoiding both null and Optional.
The convention is defined by six dates.
FraTemplate, not by this convention.| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableFraConvention.Builder
The bean-builder for
ImmutableFraConvention. |
static class |
ImmutableFraConvention.Meta
The meta-bean for
ImmutableFraConvention. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableFraConvention.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
FraTrade |
createTrade(LocalDate tradeDate,
Period periodToStart,
Period periodToEnd,
BuySell buySell,
double notional,
double fixedRate,
ReferenceData refData)
Creates a trade based on this convention, specifying the end of the FRA.
|
boolean |
equals(Object obj) |
BusinessDayAdjustment |
getBusinessDayAdjustment()
Gets the business day adjustment to apply to the start and end date,
providing a default result if no override specified.
|
Currency |
getCurrency()
Gets the primary currency,
providing a default result if no override specified.
|
DayCount |
getDayCount()
Gets the day count convention applicable,
providing a default result if no override specified.
|
FraDiscountingMethod |
getDiscounting()
Gets the method to use for discounting,
providing a default result if no override specified.
|
DaysAdjustment |
getFixingDateOffset()
Gets the offset of the fixing date from the start date,
providing a default result if no override specified.
|
IborIndex |
getIndex()
Gets the Ibor index.
|
String |
getName()
Gets the convention name, such as 'GBP-LIBOR-3M'.
|
DaysAdjustment |
getPaymentDateOffset()
Gets the offset of the payment date from the start date,
providing a default result if no override specified.
|
DaysAdjustment |
getSpotDateOffset()
Gets the offset of the spot value date from the trade date,
providing a default result if no override specified.
|
int |
hashCode() |
static ImmutableFraConvention.Meta |
meta()
The meta-bean for
ImmutableFraConvention. |
ImmutableFraConvention.Meta |
metaBean() |
static ImmutableFraConvention |
of(IborIndex index)
Obtains a convention based on the specified index.
|
ImmutableFraConvention.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
FraTrade |
toTrade(TradeInfo tradeInfo,
LocalDate startDate,
LocalDate endDate,
LocalDate paymentDate,
BuySell buySell,
double notional,
double fixedRate)
Creates a trade based on this convention.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcalculateSpotDateFromTradeDate, createTrade, extendedEnum, of, toTradepublic static ImmutableFraConvention of(IborIndex index)
The standard market convention for a FRA is based exclusively on the index.
This creates an instance that contains the index.
The instance is not dereferenced using the FraConvention name, as such
the result of this method and FraConvention.of(IborIndex) can differ.
Use the builder for unusual conventions.
of in interface FraConventionindex - the index, the market convention values are extracted from the indexpublic String getName()
This will default to the name of the index if not specified.
getName in interface NamedgetName in interface FraConventionpublic Currency getCurrency()
This is the currency of the FRA and the currency that payment is made in. The data model permits this currency to differ from that of the index, however the two are typically the same.
This will default to the currency of the index if not specified.
public DayCount getDayCount()
This is used to convert dates to a numerical value. The data model permits the day count to differ from that of the index, however the two are typically the same.
This will default to the day count of the index if not specified.
public DaysAdjustment getSpotDateOffset()
The offset is applied to the trade date and is typically plus 2 business days. The start and end date of the FRA term are relative to the spot date.
This will default to the effective date offset of the index if not specified.
getSpotDateOffset in interface FraConventionpublic BusinessDayAdjustment getBusinessDayAdjustment()
The start and end date are typically defined as valid business days and thus do not need to be adjusted. If this optional property is present, then the start and end date will be adjusted as defined here.
This will default to 'ModifiedFollowing' using the index fixing calendar if not specified.
public DaysAdjustment getFixingDateOffset()
The offset is applied to the start date and is typically minus 2 business days. The data model permits the offset to differ from that of the index, however the two are typically the same.
This will default to the fixing date offset of the index if not specified.
public DaysAdjustment getPaymentDateOffset()
Defines the offset from the start date to the payment date. In most cases, the payment date is the same as the start date, so the default of zero is appropriate.
This will default to zero if not specified.
public FraDiscountingMethod getDiscounting()
There are different approaches FRA pricing in the area of discounting. This method specifies the approach for this FRA.
This will default 'AFMA' if the index has the currency 'AUD' or 'NZD' and to 'ISDA' otherwise.
public FraTrade createTrade(LocalDate tradeDate, Period periodToStart, Period periodToEnd, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
FraConventionThis returns a trade based on the specified periods. For example, a '2 x 5' FRA has a period to the start date of 2 months and a period to the end date of 5 months.
The notional is unsigned, with buy/sell determining the direction of the trade. If buying the FRA, the floating rate is received from the counterparty, with the fixed rate being paid. If selling the FRA, the floating rate is paid to the counterparty, with the fixed rate being received.
The start date will be the trade date, plus spot offset, plus period to start, adjusted to a valid business day. The end date will be the trade date, plus spot offset, plus period to end, adjusted to a valid business day. The adjustment of the start and end date occurs at trade creation. The payment date offset is also applied at trade creation. When the Fra is resolved, the start and end date are not adjusted again but the payment date is.
createTrade in interface FraConventiontradeDate - the date of the tradeperiodToStart - the period between the spot date and the start dateperiodToEnd - the period between the spot date and the end datebuySell - the buy/sell flagnotional - the notional amount, in the payment currency of the templatefixedRate - the fixed rate, typically derived from the marketrefData - the reference data, used to resolve the trade datespublic FraTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, LocalDate paymentDate, BuySell buySell, double notional, double fixedRate)
FraConventionThis returns a trade based on the specified dates. The notional is unsigned, with buy/sell determining the direction of the trade. If buying the FRA, the floating rate is received from the counterparty, with the fixed rate being paid. If selling the FRA, the floating rate is paid to the counterparty, with the fixed rate being received.
toTrade in interface FraConventiontradeInfo - additional information about the tradestartDate - the start date, which should be adjusted to be a valid business dayendDate - the end date, which should be adjusted to be a valid business daypaymentDate - the payment date, which should be adjusted to be a valid business daybuySell - the buy/sell flagnotional - the notional amount, in the payment currency of the templatefixedRate - the fixed rate, typically derived from the marketpublic static ImmutableFraConvention.Meta meta()
ImmutableFraConvention.public static ImmutableFraConvention.Builder builder()
public ImmutableFraConvention.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic IborIndex getIndex()
The floating rate to be paid is based on this index It will be a well known market index such as 'GBP-LIBOR-3M'.
getIndex in interface FraConventionpublic ImmutableFraConvention.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.