Class BillSecurity
- java.lang.Object
-
- com.opengamma.strata.product.bond.BillSecurity
-
- All Implemented Interfaces:
LegalEntitySecurity
,Security
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class BillSecurity extends Object implements LegalEntitySecurity, org.joda.beans.ImmutableBean, Serializable
A security representing a bill.A bill is a financial instrument that represents a unique fixed payment.
Price and yield
Strata uses decimal yields and prices for bills in the trade model, pricers and market data. For example, a price of 99.32% is represented in Strata by 0.9932 and a yield of 1.32% is represented by 0.0132.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BillSecurity.Builder
The bean-builder forBillSecurity
.static class
BillSecurity.Meta
The meta-bean forBillSecurity
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BillSecurity.Builder
builder()
Returns a builder used to create an instance of the bean.BillPosition
createPosition(PositionInfo positionInfo, double longQuantity, double shortQuantity, ReferenceData refData)
Creates a position based on this security from a long and short quantity.BillPosition
createPosition(PositionInfo positionInfo, double quantity, ReferenceData refData)
Creates a position based on this security from a net quantity.Bill
createProduct(ReferenceData refData)
Creates the product associated with this security.BillTrade
createTrade(TradeInfo info, double quantity, double tradePrice, ReferenceData refData)
Creates a trade based on this security.boolean
equals(Object obj)
Currency
getCurrency()
Gets the currency that the security is traded in.DayCount
getDayCount()
Gets the day count convention applicable.SecurityInfo
getInfo()
Gets the standard security information.LegalEntityId
getLegalEntityId()
Gets the legal entity identifier.AdjustablePayment
getNotional()
Gets the adjustable notional payment of the bill notional, the amount must be positive.DaysAdjustment
getSettlementDateOffset()
Gets the number of days between valuation date and settlement date.ImmutableSet<SecurityId>
getUnderlyingIds()
Gets the set of underlying security identifiers.BillYieldConvention
getYieldConvention()
Gets yield convention.int
hashCode()
static BillSecurity.Meta
meta()
The meta-bean forBillSecurity
.BillSecurity.Meta
metaBean()
BillSecurity.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
BillSecurity
withInfo(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
-
getCurrency
public Currency getCurrency()
Description copied from interface:Security
Gets the currency that the security is traded in.- Specified by:
getCurrency
in interfaceSecurity
- Returns:
- the trading currency
-
getUnderlyingIds
public ImmutableSet<SecurityId> getUnderlyingIds()
Description copied from interface:Security
Gets 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:
getUnderlyingIds
in interfaceSecurity
- Returns:
- the underlying security identifiers
-
withInfo
public BillSecurity withInfo(SecurityInfo info)
Description copied from interface:Security
Returns an instance with the specified info.- Specified by:
withInfo
in interfaceLegalEntitySecurity
- Specified by:
withInfo
in interfaceSecurity
- Parameters:
info
- the new info- Returns:
- the instance with the specified info
-
createProduct
public Bill createProduct(ReferenceData refData)
Description copied from interface:Security
Creates 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:
createProduct
in interfaceSecurity
- Parameters:
refData
- the reference data used to find underlying securities- Returns:
- the product
-
createTrade
public BillTrade createTrade(TradeInfo info, double quantity, double tradePrice, ReferenceData refData)
Description copied from interface:Security
Creates a trade based on this security.This creates a trade of a suitable type for this security.
- Specified by:
createTrade
in 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 BillPosition createPosition(PositionInfo positionInfo, double quantity, ReferenceData refData)
Description copied from interface:Security
Creates a position based on this security from a net quantity.This creates a position of a suitable type for this security.
- Specified by:
createPosition
in 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 BillPosition createPosition(PositionInfo positionInfo, double longQuantity, double shortQuantity, ReferenceData refData)
Description copied from interface:Security
Creates 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:
createPosition
in 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 BillSecurity.Meta meta()
The meta-bean forBillSecurity
.- Returns:
- the meta-bean, not null
-
builder
public static BillSecurity.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public BillSecurity.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getInfo
public SecurityInfo getInfo()
Gets the standard security information.This includes the security identifier.
-
getNotional
public AdjustablePayment getNotional()
Gets the adjustable notional payment of the bill notional, the amount must be positive.- Returns:
- the value of the property, not null
-
getDayCount
public DayCount getDayCount()
Gets the day count convention applicable.The conversion from dates to a numerical value is made based on this day count.
- Returns:
- the value of the property, not null
-
getYieldConvention
public BillYieldConvention getYieldConvention()
Gets yield convention.The convention defines how to convert from yield to price and inversely.
- Returns:
- the value of the property, not null
-
getLegalEntityId
public LegalEntityId getLegalEntityId()
Gets the legal entity identifier.This identifier is used for the legal entity that issues the bill.
- Specified by:
getLegalEntityId
in interfaceLegalEntitySecurity
- Returns:
- the value of the property, not null
-
getSettlementDateOffset
public DaysAdjustment getSettlementDateOffset()
Gets the number of days between valuation date and settlement date.It is usually one business day for US and UK bills and two days for Euroland government bills.
- Returns:
- the value of the property, not null
-
toBuilder
public BillSecurity.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-