public interface OvernightFutureContractSpec extends Named
The contract specification defines how the future is traded. A specific future is created by specifying the year-month.
For commonly traded contract specifications, see OvernightFutureContractSpecs.
To manually create a contract specification, see ImmutableOvernightFutureContractSpec.
To register a specific contract specification, see OvernightFutureContractSpec.ini.
| Modifier and Type | Method and Description |
|---|---|
LocalDate |
calculateLastFixingDate(LocalDate referenceDate,
ReferenceData refData)
Calculates the last fixing date from the trade date.
|
LocalDate |
calculateReferenceDate(LocalDate tradeDate,
SequenceDate sequenceDate,
ReferenceData refData)
Calculates the reference date from the trade date.
|
OvernightFuturePosition |
createPosition(SecurityId securityId,
YearMonth expiry,
double quantity,
ReferenceData refData)
Creates a position based on this convention.
|
OvernightFutureTrade |
createTrade(LocalDate tradeDate,
SecurityId securityId,
SequenceDate sequenceDate,
double quantity,
double price,
ReferenceData refData)
Creates a trade based on this convention.
|
static ExtendedEnum<OvernightFutureContractSpec> |
extendedEnum()
Gets the extended enum helper.
|
OvernightIndex |
getIndex()
Gets the Overnight index.
|
String |
getName()
Gets the name that uniquely identifies this convention.
|
double |
getNotional()
Gets the notional.
|
static OvernightFutureContractSpec |
of(String uniqueName)
Obtains an instance from the specified unique name.
|
static OvernightFutureContractSpec of(String uniqueName)
uniqueName - the unique nameIllegalArgumentException - if the name is not knownstatic ExtendedEnum<OvernightFutureContractSpec> extendedEnum()
This helper allows instances of the convention to be looked up. It also provides the complete set of available instances.
OvernightIndex getIndex()
The floating rate to be paid is based on this index It will be a well known market index such as 'GBP-SONIA'.
double getNotional()
The notional is a positive number in the index currency.
OvernightFutureTrade createTrade(LocalDate tradeDate, SecurityId securityId, SequenceDate sequenceDate, double quantity, double price, ReferenceData refData)
This returns a trade based on the instructions in the SequenceDate.
The sequence date points at the expiry of the future, which is how they are referred to in the market.
tradeDate - the trade datesecurityId - the identifier of the securitysequenceDate - the date to be used from the sequence identifying the expiry of the futurequantity - the number of contracts traded, positive if buying, negative if sellingprice - the trade price of the futurerefData - the reference data, used to resolve the trade datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference dataOvernightFuturePosition createPosition(SecurityId securityId, YearMonth expiry, double quantity, ReferenceData refData)
securityId - the identifier of the securityexpiry - the expiry year monthquantity - the number of contracts traded, positive if buying, negative if sellingrefData - the reference data, used to resolve the trade datesReferenceDataNotFoundException - if an identifier cannot be resolved in the reference dataLocalDate calculateReferenceDate(LocalDate tradeDate, SequenceDate sequenceDate, ReferenceData refData)
This determines the date from the SequenceDate.
tradeDate - the trade datesequenceDate - the date to be used from the sequencerefData - the reference data, used to resolve the dateLocalDate calculateLastFixingDate(LocalDate referenceDate, ReferenceData refData)
referenceDate - the reference date of the contract, also known as the start daterefData - the reference data, used to resolve the dateString 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.