Class PortfolioHistory

java.lang.Object
markets.alpaca.client.openapi.broker.model.PortfolioHistory
All Implemented Interfaces:
Serializable

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class PortfolioHistory extends Object implements Serializable
Timeseries data for equity and profit loss information of the account.
See Also:
  • Field Details

  • Constructor Details

    • PortfolioHistory

      public PortfolioHistory()
  • Method Details

    • baseValue

      public PortfolioHistory baseValue(@Nonnull BigDecimal baseValue)
    • getBaseValue

      @Nonnull public BigDecimal getBaseValue()
      basis in dollar of the profit loss calculation
      Returns:
      baseValue
    • setBaseValue

      public void setBaseValue(@Nonnull BigDecimal baseValue)
    • baseValueAsof

      public PortfolioHistory baseValueAsof(@Nullable LocalDate baseValueAsof)
    • getBaseValueAsof

      @Nullable public LocalDate getBaseValueAsof()
      If included, then it indicates that the base_value is the account's closing equity value at this trading date. If not specified, then the baseline calculation is done against the earliest returned data item. This could happen for accounts without prior closing balances (e.g. new account) or for queries with 1D timeframes, where the first data point is used as a reference point.
      Returns:
      baseValueAsof
    • setBaseValueAsof

      public void setBaseValueAsof(@Nullable LocalDate baseValueAsof)
    • cashflow

      public PortfolioHistory cashflow(@Nullable Object cashflow)
    • getCashflow

      @Nullable public Object getCashflow()
      accumulated value in dollar amount as of the end of each time window
      Returns:
      cashflow
    • setCashflow

      public void setCashflow(@Nullable Object cashflow)
    • equity

      public PortfolioHistory equity(@Nonnull List<BigDecimal> equity)
    • addEquityItem

      public PortfolioHistory addEquityItem(BigDecimal equityItem)
    • getEquity

      @Nonnull public List<BigDecimal> getEquity()
      equity value of the account in dollar amount as of the end of each time window
      Returns:
      equity
    • setEquity

      public void setEquity(@Nonnull List<BigDecimal> equity)
    • profitLoss

      public PortfolioHistory profitLoss(@Nonnull List<BigDecimal> profitLoss)
    • addProfitLossItem

      public PortfolioHistory addProfitLossItem(BigDecimal profitLossItem)
    • getProfitLoss

      @Nonnull public List<BigDecimal> getProfitLoss()
      profit/loss in dollar from the base value
      Returns:
      profitLoss
    • setProfitLoss

      public void setProfitLoss(@Nonnull List<BigDecimal> profitLoss)
    • profitLossPct

      public PortfolioHistory profitLossPct(@Nonnull List<BigDecimal> profitLossPct)
    • addProfitLossPctItem

      public PortfolioHistory addProfitLossPctItem(BigDecimal profitLossPctItem)
    • getProfitLossPct

      @Nonnull public List<BigDecimal> getProfitLossPct()
      profit/loss in percentage from the base value
      Returns:
      profitLossPct
    • setProfitLossPct

      public void setProfitLossPct(@Nonnull List<BigDecimal> profitLossPct)
    • timeframe

      public PortfolioHistory timeframe(@Nonnull String timeframe)
    • getTimeframe

      @Nonnull public String getTimeframe()
      time window size of each data element
      Returns:
      timeframe
    • setTimeframe

      public void setTimeframe(@Nonnull String timeframe)
    • timestamp

      public PortfolioHistory timestamp(@Nonnull List<Integer> timestamp)
    • addTimestampItem

      public PortfolioHistory addTimestampItem(Integer timestampItem)
    • getTimestamp

      @Nonnull public List<Integer> getTimestamp()
      Time of each data element, left-labeled (the beginning of time window). The values returned are in [UNIX epoch format](https://en.wikipedia.org/wiki/Unix_time).
      Returns:
      timestamp
    • setTimestamp

      public void setTimestamp(@Nonnull List<Integer> timestamp)
    • putAdditionalProperty

      public PortfolioHistory 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 PortfolioHistory 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 PortfolioHistory
    • fromJson

      public static PortfolioHistory fromJson(String jsonString) throws IOException
      Create an instance of PortfolioHistory given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of PortfolioHistory
      Throws:
      IOException - if the JSON string is invalid with respect to PortfolioHistory
    • toJson

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