Interface Security
-
- All Known Subinterfaces:
EtdSecurity
,LegalEntitySecurity
,RateIndexSecurity
- All Known Implementing Classes:
BillSecurity
,BondFutureOptionSecurity
,BondFutureSecurity
,CapitalIndexedBondSecurity
,DsfSecurity
,EtdFutureSecurity
,EtdOptionSecurity
,FixedCouponBondSecurity
,GenericSecurity
,IborFutureOptionSecurity
,IborFutureSecurity
,OvernightFutureSecurity
public interface Security
A security that can be traded.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 inReferenceData
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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getInfo
SecurityInfo getInfo()
Gets the standard security information.All securities contain this standard set of information. It includes the identifier, information about the price and an extensible data map.
- Returns:
- the security information
-
getSecurityId
default SecurityId getSecurityId()
Gets the security identifier.This identifier uniquely identifies the security within the system.
- Returns:
- the security identifier
-
getCurrency
default Currency getCurrency()
Gets the currency that the security is traded in.- Returns:
- the trading currency
-
getUnderlyingIds
ImmutableSet<SecurityId> getUnderlyingIds()
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.
- Returns:
- the underlying security identifiers
-
withInfo
Security withInfo(SecurityInfo info)
Returns an instance with the specified info.- Parameters:
info
- the new info- Returns:
- the instance with the specified info
-
createProduct
SecuritizedProduct createProduct(ReferenceData refData)
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.
- Parameters:
refData
- the reference data used to find underlying securities- Returns:
- the product
- Throws:
UnsupportedOperationException
- if the security does not contain information about the product model
-
createTrade
SecurityQuantityTrade createTrade(TradeInfo tradeInfo, double quantity, double tradePrice, ReferenceData refData)
Creates a trade based on this security.This creates a trade of a suitable type for this security.
- Parameters:
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 securities- Returns:
- the trade
-
createPosition
Position createPosition(PositionInfo positionInfo, double quantity, ReferenceData refData)
Creates a position based on this security from a net quantity.This creates a position of a suitable type for this security.
- Parameters:
positionInfo
- the position informationquantity
- the number of contracts in the positionrefData
- the reference data used to find underlying securities- Returns:
- the position
-
createPosition
Position createPosition(PositionInfo positionInfo, double longQuantity, double shortQuantity, ReferenceData refData)
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.
- 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
-
-