public interface Position extends PortfolioItem, SecurityQuantity
This is used to represent the total quantity of a Security.
A position is effectively the sum of one or more trades.
Implementations of this interface must be immutable beans.
| Modifier and Type | Method and Description |
|---|---|
PositionInfo |
getInfo()
Gets the standard position information.
|
double |
getQuantity()
Gets the net quantity of the security.
|
SecurityId |
getSecurityId()
Gets the identifier of the underlying security.
|
default PortfolioItemSummary |
summarize()
Summarizes the portfolio item.
|
Position |
withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.
|
Position |
withQuantity(double quantity)
Returns an instance with the specified quantity.
|
getIddefault PortfolioItemSummary summarize()
PortfolioItemThis provides a summary, including a human readable description.
summarize in interface PortfolioItemPositionInfo getInfo()
All positions contain this standard set of information. It includes the identifier and an extensible data map.
getInfo in interface PortfolioItemSecurityId getSecurityId()
This identifier uniquely identifies the security within the system.
getSecurityId in interface SecurityQuantitydouble getQuantity()
This returns the net quantity of the underlying security. The result is positive if the net position is long and negative if the net position is short.
getQuantity in interface SecurityQuantityPosition withInfo(PortfolioItemInfo info)
withInfo in interface PortfolioIteminfo - the new infoPosition withQuantity(double quantity)
quantity - the new quantityCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.