Class BondFutureSecurity
- java.lang.Object
-
- com.opengamma.strata.product.bond.BondFutureSecurity
-
- All Implemented Interfaces:
Security,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class BondFutureSecurity extends Object implements Security, org.joda.beans.ImmutableBean, Serializable
A security representing a futures contract, based on a basket of fixed coupon bonds.A bond future is a financial instrument that is based on the future value of a basket of fixed coupon bonds. The profit or loss of a bond future is settled daily.
Price
Strata uses decimal prices for bond futures in the trade model, pricers and market data. This is coherent with the pricing ofFixedCouponBond. The bond futures delivery is a bond for an amount computed from the bond future price, a conversion factor and the accrued interest.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBondFutureSecurity.BuilderThe bean-builder forBondFutureSecurity.static classBondFutureSecurity.MetaThe meta-bean forBondFutureSecurity.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BondFutureSecurity.Builderbuilder()Returns a builder used to create an instance of the bean.BondFuturePositioncreatePosition(PositionInfo positionInfo, double longQuantity, double shortQuantity, ReferenceData refData)Creates a position based on this security from a long and short quantity.BondFuturePositioncreatePosition(PositionInfo positionInfo, double quantity, ReferenceData refData)Creates a position based on this security from a net quantity.BondFuturecreateProduct(ReferenceData refData)Creates the product associated with this security.BondFutureTradecreateTrade(TradeInfo info, double quantity, double tradePrice, ReferenceData refData)Creates a trade based on this security.booleanequals(Object obj)ImmutableList<Double>getConversionFactors()Gets the conversion factor for each bond in the basket.CurrencygetCurrency()Gets the currency that the future is traded in.ImmutableList<SecurityId>getDeliveryBasketIds()Gets the basket of deliverable bonds.Optional<LocalDate>getFirstDeliveryDate()Gets the first delivery date.LocalDategetFirstNoticeDate()Gets the first notice date.SecurityInfogetInfo()Gets the standard security information.Optional<LocalDate>getLastDeliveryDate()Gets the last delivery date.LocalDategetLastNoticeDate()Gets the last notice date.LocalDategetLastTradeDate()Gets the last trading date.RoundinggetRounding()Gets the definition of how to round the futures price, defaulted to no rounding.ImmutableSet<SecurityId>getUnderlyingIds()Gets the set of underlying security identifiers.inthashCode()static BondFutureSecurity.Metameta()The meta-bean forBondFutureSecurity.BondFutureSecurity.MetametaBean()BondFutureSecurity.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()BondFutureSecuritywithInfo(SecurityInfo info)Returns an instance with the specified info.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.Security
getSecurityId
-
-
-
-
Method Detail
-
getUnderlyingIds
public ImmutableSet<SecurityId> getUnderlyingIds()
Description copied from interface:SecurityGets the set of underlying security identifiers.The set must contain all the security identifiers that this security directly refers to. For example, a bond future will return the identifiers of the underlying basket of bonds, but a bond future option will only return the identifier of the underlying future, not the basket.
- Specified by:
getUnderlyingIdsin interfaceSecurity- Returns:
- the underlying security identifiers
-
withInfo
public BondFutureSecurity withInfo(SecurityInfo info)
Description copied from interface:SecurityReturns an instance with the specified info.
-
createProduct
public BondFuture createProduct(ReferenceData refData)
Description copied from interface:SecurityCreates the product associated with this security.The product of a security is distinct from the security. The product includes the financial details from this security, but excludes the additional information. The product also includes the products of any underlying securities.
- Specified by:
createProductin interfaceSecurity- Parameters:
refData- the reference data used to find underlying securities- Returns:
- the product
-
createTrade
public BondFutureTrade createTrade(TradeInfo info, double quantity, double tradePrice, ReferenceData refData)
Description copied from interface:SecurityCreates a trade based on this security.This creates a trade of a suitable type for this security.
- Specified by:
createTradein interfaceSecurity- Parameters:
info- the trade informationquantity- the number of contracts in the tradetradePrice- the price agreed when the trade occurredrefData- the reference data used to find underlying securities- Returns:
- the trade
-
createPosition
public BondFuturePosition createPosition(PositionInfo positionInfo, double quantity, ReferenceData refData)
Description copied from interface:SecurityCreates a position based on this security from a net quantity.This creates a position of a suitable type for this security.
- Specified by:
createPositionin interfaceSecurity- Parameters:
positionInfo- the position informationquantity- the number of contracts in the positionrefData- the reference data used to find underlying securities- Returns:
- the position
-
createPosition
public BondFuturePosition createPosition(PositionInfo positionInfo, double longQuantity, double shortQuantity, ReferenceData refData)
Description copied from interface:SecurityCreates a position based on this security from a long and short quantity.This creates a position of a suitable type for this security.
The long quantity and short quantity must be zero or positive, not negative.
- Specified by:
createPositionin interfaceSecurity- Parameters:
positionInfo- the position informationlongQuantity- the long quantity in the positionshortQuantity- the short quantity in the positionrefData- the reference data used to find underlying securities- Returns:
- the position
-
meta
public static BondFutureSecurity.Meta meta()
The meta-bean forBondFutureSecurity.- Returns:
- the meta-bean, not null
-
builder
public static BondFutureSecurity.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public BondFutureSecurity.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getInfo
public SecurityInfo getInfo()
Gets the standard security information.This includes the security identifier.
-
getCurrency
public Currency getCurrency()
Gets the currency that the future is traded in.- Specified by:
getCurrencyin interfaceSecurity- Returns:
- the value of the property, not null
-
getDeliveryBasketIds
public ImmutableList<SecurityId> getDeliveryBasketIds()
Gets the basket of deliverable bonds.The underlying which will be delivered in the future time is chosen from a basket of underling securities. This must not be empty.
All of the underlying bonds must have the same notional and currency.
- Returns:
- the value of the property, not empty
-
getConversionFactors
public ImmutableList<Double> getConversionFactors()
Gets the conversion factor for each bond in the basket.The price of each underlying security in the basket is rescaled by the conversion factor. This must not be empty, and its size must be the same as the size of
deliveryBasketIds.All of the underlying bonds must have the same notional and currency.
- Returns:
- the value of the property, not empty
-
getLastTradeDate
public LocalDate getLastTradeDate()
Gets the last trading date.The future security is traded until this date.
- Returns:
- the value of the property, not null
-
getFirstNoticeDate
public LocalDate getFirstNoticeDate()
Gets the first notice date.The first date on which the delivery of the underlying is authorized.
- Returns:
- the value of the property, not null
-
getLastNoticeDate
public LocalDate getLastNoticeDate()
Gets the last notice date.The last date on which the delivery of the underlying is authorized.
- Returns:
- the value of the property, not null
-
getFirstDeliveryDate
public Optional<LocalDate> getFirstDeliveryDate()
Gets the first delivery date.The first date on which the underlying is delivered.
If not specified, the date will be computed from
firstNoticeDateby usingsettlementDateOffsetin the first element of the delivery basket when the future is resolved.- Returns:
- the optional value of the property, not null
-
getLastDeliveryDate
public Optional<LocalDate> getLastDeliveryDate()
Gets the last delivery date.The last date on which the underlying is delivered.
If not specified, the date will be computed from
lastNoticeDateby usingsettlementDateOffsetin the first element of the delivery basket when the future is resolved.- Returns:
- the optional value of the property, not null
-
getRounding
public Rounding getRounding()
Gets the definition of how to round the futures price, defaulted to no rounding.The price is represented in decimal form, not percentage form. As such, the decimal places expressed by the rounding refers to this decimal form. For example, the common market price of 99.7125 for a 0.2875% rate is represented as 0.997125 which has 6 decimal places.
- Returns:
- the value of the property, not null
-
toBuilder
public BondFutureSecurity.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-