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:
  • Field Details

  • Constructor Details

    • Position

      public Position()
  • Method Details

    • assetClass

      public Position assetClass(@Nonnull AssetClass assetClass)
    • getAssetClass

      @Nonnull public AssetClass getAssetClass()
      Get assetClass
      Returns:
      assetClass
    • setAssetClass

      public void setAssetClass(@Nonnull AssetClass assetClass)
    • assetId

      public Position assetId(@Nonnull UUID assetId)
    • getAssetId

      @Nonnull public UUID getAssetId()
      Asset ID (For options this represents the option contract ID)
      Returns:
      assetId
    • setAssetId

      public void setAssetId(@Nonnull UUID assetId)
    • assetMarginable

      public Position assetMarginable(@Nullable Boolean assetMarginable)
    • getAssetMarginable

      @Nullable public Boolean getAssetMarginable()
      Indicates if this asset is marginable
      Returns:
      assetMarginable
    • setAssetMarginable

      public void setAssetMarginable(@Nullable Boolean assetMarginable)
    • avgEntryPrice

      public Position avgEntryPrice(@Nonnull String avgEntryPrice)
    • getAvgEntryPrice

      @Nonnull public String getAvgEntryPrice()
      Average entry price of the position
      Returns:
      avgEntryPrice
    • setAvgEntryPrice

      public void setAvgEntryPrice(@Nonnull String avgEntryPrice)
    • avgEntrySwapRate

      public Position avgEntrySwapRate(@Nullable BigDecimal avgEntrySwapRate)
    • getAvgEntrySwapRate

      @Nullable public BigDecimal getAvgEntrySwapRate()
      The average swap rate of the position. This is only returned for LCT accounts.
      Returns:
      avgEntrySwapRate
    • setAvgEntrySwapRate

      public void setAvgEntrySwapRate(@Nullable BigDecimal avgEntrySwapRate)
    • changeToday

      public Position changeToday(@Nonnull BigDecimal changeToday)
    • getChangeToday

      @Nonnull public BigDecimal getChangeToday()
      Percent change from last day price (by a factor of 1)
      Returns:
      changeToday
    • setChangeToday

      public void setChangeToday(@Nonnull BigDecimal changeToday)
    • costBasis

      public Position costBasis(@Nonnull BigDecimal costBasis)
    • getCostBasis

      @Nonnull public BigDecimal getCostBasis()
      Total cost basis
      Returns:
      costBasis
    • setCostBasis

      public void setCostBasis(@Nonnull BigDecimal costBasis)
    • currentPrice

      public Position currentPrice(@Nonnull BigDecimal currentPrice)
    • getCurrentPrice

      @Nonnull public BigDecimal getCurrentPrice()
      Current asset price per share
      Returns:
      currentPrice
    • setCurrentPrice

      public void setCurrentPrice(@Nonnull BigDecimal currentPrice)
    • exchange

      public Position exchange(@Nonnull String exchange)
    • getExchange

      @Nonnull public String getExchange()
      Exchange name of the asset
      Returns:
      exchange
    • setExchange

      public void setExchange(@Nonnull String exchange)
    • lastdayPrice

      public Position lastdayPrice(@Nonnull BigDecimal lastdayPrice)
    • getLastdayPrice

      @Nonnull public BigDecimal getLastdayPrice()
      Last day's asset price per share based on the closing value of the last trading day
      Returns:
      lastdayPrice
    • setLastdayPrice

      public void setLastdayPrice(@Nonnull BigDecimal lastdayPrice)
    • marketValue

      public Position marketValue(@Nonnull BigDecimal marketValue)
    • getMarketValue

      @Nonnull public BigDecimal getMarketValue()
      Total market value of the position
      Returns:
      marketValue
    • setMarketValue

      public void setMarketValue(@Nonnull BigDecimal marketValue)
    • qty

      public Position qty(@Nonnull String qty)
    • getQty

      @Nonnull public String getQty()
      The number of shares
      Returns:
      qty
    • setQty

      public void setQty(@Nonnull String qty)
    • qtyAvailable

      public Position qtyAvailable(@Nonnull String qtyAvailable)
    • getQtyAvailable

      @Nonnull public String getQtyAvailable()
      Total number of shares available minus open orders / locked for options covered call
      Returns:
      qtyAvailable
    • setQtyAvailable

      public void setQtyAvailable(@Nonnull String qtyAvailable)
    • side

      public Position side(@Nonnull Position.SideEnum side)
    • getSide

      @Nonnull public Position.SideEnum getSide()
      Get side
      Returns:
      side
    • setSide

      public void setSide(@Nonnull Position.SideEnum side)
    • swapRate

      public Position swapRate(@Nullable BigDecimal swapRate)
    • getSwapRate

      @Nullable public BigDecimal getSwapRate()
      The latest swap rate. This is only returned for LCT accounts.
      Returns:
      swapRate
    • setSwapRate

      public void setSwapRate(@Nullable BigDecimal swapRate)
    • symbol

      public Position symbol(@Nonnull String symbol)
    • getSymbol

      @Nonnull public String getSymbol()
      Asset symbol
      Returns:
      symbol
    • setSymbol

      public void setSymbol(@Nonnull String symbol)
    • unrealizedIntradayPl

      public Position unrealizedIntradayPl(@Nonnull BigDecimal unrealizedIntradayPl)
    • getUnrealizedIntradayPl

      @Nonnull public BigDecimal getUnrealizedIntradayPl()
      Unrealized profit/loss for the day
      Returns:
      unrealizedIntradayPl
    • setUnrealizedIntradayPl

      public void setUnrealizedIntradayPl(@Nonnull BigDecimal unrealizedIntradayPl)
    • unrealizedIntradayPlpc

      public Position unrealizedIntradayPlpc(@Nonnull BigDecimal unrealizedIntradayPlpc)
    • getUnrealizedIntradayPlpc

      @Nonnull public BigDecimal getUnrealizedIntradayPlpc()
      Unrealized interday profit/loss percent (by a factor of 1)
      Returns:
      unrealizedIntradayPlpc
    • setUnrealizedIntradayPlpc

      public void setUnrealizedIntradayPlpc(@Nonnull BigDecimal unrealizedIntradayPlpc)
    • unrealizedPl

      public Position unrealizedPl(@Nonnull BigDecimal unrealizedPl)
    • getUnrealizedPl

      @Nonnull public BigDecimal getUnrealizedPl()
      Unrealized profit/loss
      Returns:
      unrealizedPl
    • setUnrealizedPl

      public void setUnrealizedPl(@Nonnull BigDecimal unrealizedPl)
    • unrealizedPlpc

      public Position unrealizedPlpc(@Nonnull BigDecimal unrealizedPlpc)
    • getUnrealizedPlpc

      @Nonnull public BigDecimal getUnrealizedPlpc()
      Unrealized profit/loss percent (by a factor of 1)
      Returns:
      unrealizedPlpc
    • setUnrealizedPlpc

      public void setUnrealizedPlpc(@Nonnull BigDecimal unrealizedPlpc)
    • usd

      public Position usd(@Nullable USDPosition usd)
    • getUsd

      @Nullable public USDPosition getUsd()
      Get usd
      Returns:
      usd
    • setUsd

      public void setUsd(@Nullable USDPosition usd)
    • putAdditionalProperty

      public Position putAdditionalProperty(String key, Object value)
      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 property
      value - value of the property
      Returns:
      the Position instance itself
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
      Return the additional (undeclared) property.
      Returns:
      a map of objects
    • getAdditionalProperty

      public Object getAdditionalProperty(String key)
      Return the additional (undeclared) property with the specified name.
      Parameters:
      key - name of the property
      Returns:
      an object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      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

      public static Position fromJson(String jsonString) throws IOException
      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

      public String toJson()
      Convert an instance of Position to an JSON string
      Returns:
      JSON string