Class Position
java.lang.Object
markets.alpaca.client.openapi.broker.model.Position
- All Implemented Interfaces:
Serializable
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class Position
extends Object
implements Serializable
Position
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumGets or Sets side -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassetClass(AssetClass assetClass) assetMarginable(Boolean assetMarginable) avgEntryPrice(String avgEntryPrice) avgEntrySwapRate(BigDecimal avgEntrySwapRate) changeToday(BigDecimal changeToday) costBasis(BigDecimal costBasis) currentPrice(BigDecimal currentPrice) booleanstatic PositionCreate an instance of Position given an JSON stringReturn the additional (undeclared) property.Return the additional (undeclared) property with the specified name.Get assetClassAsset ID (For options this represents the option contract ID)Indicates if this asset is marginableAverage entry price of the positionThe average swap rate of the position.Percent change from last day price (by a factor of 1)Total cost basisCurrent asset price per shareExchange name of the assetLast day's asset price per share based on the closing value of the last trading dayTotal market value of the positiongetQty()The number of sharesTotal number of shares available minus open orders / locked for options covered callgetSide()Get sideThe latest swap rate.Asset symbolUnrealized profit/loss for the dayUnrealized interday profit/loss percent (by a factor of 1)Unrealized profit/lossUnrealized profit/loss percent (by a factor of 1)getUsd()Get usdinthashCode()lastdayPrice(BigDecimal lastdayPrice) marketValue(BigDecimal marketValue) putAdditionalProperty(String key, Object value) Set the additional (undeclared) property with the specified name and value.qtyAvailable(String qtyAvailable) voidsetAssetClass(AssetClass assetClass) voidsetAssetId(UUID assetId) voidsetAssetMarginable(Boolean assetMarginable) voidsetAvgEntryPrice(String avgEntryPrice) voidsetAvgEntrySwapRate(BigDecimal avgEntrySwapRate) voidsetChangeToday(BigDecimal changeToday) voidsetCostBasis(BigDecimal costBasis) voidsetCurrentPrice(BigDecimal currentPrice) voidsetExchange(String exchange) voidsetLastdayPrice(BigDecimal lastdayPrice) voidsetMarketValue(BigDecimal marketValue) voidvoidsetQtyAvailable(String qtyAvailable) voidsetSide(Position.SideEnum side) voidsetSwapRate(BigDecimal swapRate) voidvoidsetUnrealizedIntradayPl(BigDecimal unrealizedIntradayPl) voidsetUnrealizedIntradayPlpc(BigDecimal unrealizedIntradayPlpc) voidsetUnrealizedPl(BigDecimal unrealizedPl) voidsetUnrealizedPlpc(BigDecimal unrealizedPlpc) voidsetUsd(USDPosition usd) side(Position.SideEnum side) swapRate(BigDecimal swapRate) toJson()Convert an instance of Position to an JSON stringtoString()unrealizedIntradayPl(BigDecimal unrealizedIntradayPl) unrealizedIntradayPlpc(BigDecimal unrealizedIntradayPlpc) unrealizedPl(BigDecimal unrealizedPl) unrealizedPlpc(BigDecimal unrealizedPlpc) usd(USDPosition usd) static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_ASSET_CLASS
- See Also:
-
SERIALIZED_NAME_ASSET_ID
- See Also:
-
SERIALIZED_NAME_ASSET_MARGINABLE
- See Also:
-
SERIALIZED_NAME_AVG_ENTRY_PRICE
- See Also:
-
SERIALIZED_NAME_AVG_ENTRY_SWAP_RATE
- See Also:
-
SERIALIZED_NAME_CHANGE_TODAY
- See Also:
-
SERIALIZED_NAME_COST_BASIS
- See Also:
-
SERIALIZED_NAME_CURRENT_PRICE
- See Also:
-
SERIALIZED_NAME_EXCHANGE
- See Also:
-
SERIALIZED_NAME_LASTDAY_PRICE
- See Also:
-
SERIALIZED_NAME_MARKET_VALUE
- See Also:
-
SERIALIZED_NAME_QTY
- See Also:
-
SERIALIZED_NAME_QTY_AVAILABLE
- See Also:
-
SERIALIZED_NAME_SIDE
- See Also:
-
SERIALIZED_NAME_SWAP_RATE
- See Also:
-
SERIALIZED_NAME_SYMBOL
- See Also:
-
SERIALIZED_NAME_UNREALIZED_INTRADAY_PL
- See Also:
-
SERIALIZED_NAME_UNREALIZED_INTRADAY_PLPC
- See Also:
-
SERIALIZED_NAME_UNREALIZED_PL
- See Also:
-
SERIALIZED_NAME_UNREALIZED_PLPC
- See Also:
-
SERIALIZED_NAME_USD
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
Position
public Position()
-
-
Method Details
-
assetClass
-
getAssetClass
Get assetClass- Returns:
- assetClass
-
setAssetClass
-
assetId
-
getAssetId
Asset ID (For options this represents the option contract ID)- Returns:
- assetId
-
setAssetId
-
assetMarginable
-
getAssetMarginable
Indicates if this asset is marginable- Returns:
- assetMarginable
-
setAssetMarginable
-
avgEntryPrice
-
getAvgEntryPrice
Average entry price of the position- Returns:
- avgEntryPrice
-
setAvgEntryPrice
-
avgEntrySwapRate
-
getAvgEntrySwapRate
The average swap rate of the position. This is only returned for LCT accounts.- Returns:
- avgEntrySwapRate
-
setAvgEntrySwapRate
-
changeToday
-
getChangeToday
Percent change from last day price (by a factor of 1)- Returns:
- changeToday
-
setChangeToday
-
costBasis
-
getCostBasis
Total cost basis- Returns:
- costBasis
-
setCostBasis
-
currentPrice
-
getCurrentPrice
Current asset price per share- Returns:
- currentPrice
-
setCurrentPrice
-
exchange
-
getExchange
Exchange name of the asset- Returns:
- exchange
-
setExchange
-
lastdayPrice
-
getLastdayPrice
Last day's asset price per share based on the closing value of the last trading day- Returns:
- lastdayPrice
-
setLastdayPrice
-
marketValue
-
getMarketValue
Total market value of the position- Returns:
- marketValue
-
setMarketValue
-
qty
-
getQty
The number of shares- Returns:
- qty
-
setQty
-
qtyAvailable
-
getQtyAvailable
Total number of shares available minus open orders / locked for options covered call- Returns:
- qtyAvailable
-
setQtyAvailable
-
side
-
getSide
Get side- Returns:
- side
-
setSide
-
swapRate
-
getSwapRate
The latest swap rate. This is only returned for LCT accounts.- Returns:
- swapRate
-
setSwapRate
-
symbol
-
getSymbol
Asset symbol- Returns:
- symbol
-
setSymbol
-
unrealizedIntradayPl
-
getUnrealizedIntradayPl
Unrealized profit/loss for the day- Returns:
- unrealizedIntradayPl
-
setUnrealizedIntradayPl
-
unrealizedIntradayPlpc
-
getUnrealizedIntradayPlpc
Unrealized interday profit/loss percent (by a factor of 1)- Returns:
- unrealizedIntradayPlpc
-
setUnrealizedIntradayPlpc
-
unrealizedPl
-
getUnrealizedPl
Unrealized profit/loss- Returns:
- unrealizedPl
-
setUnrealizedPl
-
unrealizedPlpc
-
getUnrealizedPlpc
Unrealized profit/loss percent (by a factor of 1)- Returns:
- unrealizedPlpc
-
setUnrealizedPlpc
-
usd
-
getUsd
Get usd- Returns:
- usd
-
setUsd
-
putAdditionalProperty
Set the additional (undeclared) property with the specified name and value. If the property does not already exist, create it otherwise replace it.- Parameters:
key- name of the propertyvalue- value of the property- Returns:
- the Position instance itself
-
getAdditionalProperties
Return the additional (undeclared) property.- Returns:
- a map of objects
-
getAdditionalProperty
Return the additional (undeclared) property with the specified name.- Parameters:
key- name of the property- Returns:
- an object
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement- JSON Element- Throws:
IOException- if the JSON Element is invalid with respect to Position
-
fromJson
Create an instance of Position given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Position
- Throws:
IOException- if the JSON string is invalid with respect to Position
-
toJson
Convert an instance of Position to an JSON string- Returns:
- JSON string
-