public interface FraConvention extends TradeConvention, Named
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, the convention is set to be created on the fly based on the index.
To manually create a convention, see ImmutableFraConvention.
To register a specific convention, see FraConvention.ini.
| Modifier and Type | Method and Description |
|---|---|
default LocalDate |
calculateSpotDateFromTradeDate(LocalDate tradeDate,
ReferenceData refData)
Calculates the spot date from the trade date.
|
default FraTrade |
createTrade(LocalDate tradeDate,
Period periodToStart,
BuySell buySell,
double notional,
double fixedRate,
ReferenceData refData)
Creates a trade based on this convention, using the index tenor to define the end of the FRA.
|
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.
|
static ExtendedEnum<FraConvention> |
extendedEnum()
Gets the extended enum helper.
|
IborIndex |
getIndex()
Gets the Ibor index.
|
String |
getName()
Gets the name that uniquely identifies this convention.
|
DaysAdjustment |
getSpotDateOffset()
Gets the offset of the spot value date from the trade date.
|
static FraConvention |
of(IborIndex index)
Obtains a convention based on the specified index.
|
static FraConvention |
of(String uniqueName)
Obtains an instance from the specified unique name.
|
default FraTrade |
toTrade(LocalDate tradeDate,
LocalDate startDate,
LocalDate endDate,
LocalDate paymentDate,
BuySell buySell,
double notional,
double fixedRate)
Creates a trade based on this convention.
|
FraTrade |
toTrade(TradeInfo tradeInfo,
LocalDate startDate,
LocalDate endDate,
LocalDate paymentDate,
BuySell buySell,
double notional,
double fixedRate)
Creates a trade based on this convention.
|
static FraConvention of(String uniqueName)
uniqueName - the unique nameIllegalArgumentException - if the name is not knownstatic FraConvention of(IborIndex index)
This uses the index name to find the matching convention. By default, this will always return a convention, however configuration may be added to restrict the conventions that are registered.
index - the index, from which the index name is used to find the matching conventionIllegalArgumentException - if no convention is registered for the indexstatic ExtendedEnum<FraConvention> extendedEnum()
This helper allows instances of the convention to be looked up. It also provides the complete set of available instances.
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'.
DaysAdjustment getSpotDateOffset()
The offset is applied to the trade date to find the start date. A typical value is "plus 2 business days".
default FraTrade createTrade(LocalDate tradeDate, Period periodToStart, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
This returns a trade based on the specified period to start. For example, a '2 x 5' FRA has a period to the start date of 2 months. The period to the end, 5 months, is implied by adding the tenor of the index, 3 months, to the period to start.
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 start, plus index tenor, 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.
tradeDate - the date of the tradeperiodToStart - the period between the spot date and the start 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 datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference dataFraTrade createTrade(LocalDate tradeDate, Period periodToStart, Period periodToEnd, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
This 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.
tradeDate - 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 datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference datadefault FraTrade toTrade(LocalDate tradeDate, LocalDate startDate, LocalDate endDate, LocalDate paymentDate, BuySell buySell, double notional, double fixedRate)
This 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.
tradeDate - the date of 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 marketFraTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, LocalDate paymentDate, BuySell buySell, double notional, double fixedRate)
This 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.
tradeInfo - 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 marketdefault LocalDate calculateSpotDateFromTradeDate(LocalDate tradeDate, ReferenceData refData)
tradeDate - the trade daterefData - the reference data, used to resolve the dateReferenceDataNotFoundException - if an identifier cannot be resolved in the reference dataString getName()
This name is used in serialization and can be parsed using of(String).
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.