public interface Security
A security is one of the building blocks of finance, representing a fungible instrument that can be traded.
This is intended to cover instruments such as listed equities, bonds and exchange traded derivatives (ETD).
Within Strata, a financial instrument is a security if it is a standardized
exchange-based contract that can be referenced by a SecurityId.
The security can be looked up in ReferenceData using the identifier.
It is intended that Over-The-Counter (OTC) instruments, such as an interest rate swap, are embedded directly within the trade, rather than handled as one-off securities.
Implementations of this interface must be immutable beans.
| Modifier and Type | Method and Description |
|---|---|
Position |
createPosition(PositionInfo positionInfo,
double longQuantity,
double shortQuantity,
ReferenceData refData)
Creates a position based on this security from a long and short quantity.
|
Position |
createPosition(PositionInfo positionInfo,
double quantity,
ReferenceData refData)
Creates a position based on this security from a net quantity.
|
SecuritizedProduct |
createProduct(ReferenceData refData)
Creates the product associated with this security.
|
SecurityQuantityTrade |
createTrade(TradeInfo tradeInfo,
double quantity,
double tradePrice,
ReferenceData refData)
Creates a trade based on this security.
|
default Currency |
getCurrency()
Gets the currency that the security is traded in.
|
SecurityInfo |
getInfo()
Gets the standard security information.
|
default SecurityId |
getSecurityId()
Gets the security identifier.
|
ImmutableSet<SecurityId> |
getUnderlyingIds()
Gets the set of underlying security identifiers.
|
Security |
withInfo(SecurityInfo info)
Returns an instance with the specified info.
|
SecurityInfo getInfo()
All securities contain this standard set of information. It includes the identifier, information about the price and an extensible data map.
default SecurityId getSecurityId()
This identifier uniquely identifies the security within the system.
default Currency getCurrency()
ImmutableSet<SecurityId> getUnderlyingIds()
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.
Security withInfo(SecurityInfo info)
info - the new infoSecuritizedProduct createProduct(ReferenceData refData)
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.
refData - the reference data used to find underlying securitiesUnsupportedOperationException - if the security does not contain information about the product modelSecurityQuantityTrade createTrade(TradeInfo tradeInfo, double quantity, double tradePrice, ReferenceData refData)
This creates a trade of a suitable type for this security.
tradeInfo - the trade informationquantity - the number of contracts in the tradetradePrice - the price agreed when the trade occurredrefData - the reference data used to find underlying securitiesPosition createPosition(PositionInfo positionInfo, double quantity, ReferenceData refData)
This creates a position of a suitable type for this security.
positionInfo - the position informationquantity - the number of contracts in the positionrefData - the reference data used to find underlying securitiesPosition createPosition(PositionInfo positionInfo, double longQuantity, double shortQuantity, ReferenceData refData)
This creates a position of a suitable type for this security.
The long quantity and short quantity must be zero or positive, not negative.
positionInfo - the position informationlongQuantity - the long quantity in the positionshortQuantity - the short quantity in the positionrefData - the reference data used to find underlying securitiesCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.