Class PortfolioHistory
java.lang.Object
markets.alpaca.client.openapi.trading.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:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEquityItem(BigDecimal equityItem) addProfitLossItem(BigDecimal profitLossItem) addProfitLossPctItem(BigDecimal profitLossPctItem) addTimestampItem(Integer timestampItem) baseValue(BigDecimal baseValue) baseValueAsof(LocalDate baseValueAsof) booleanequity(List<BigDecimal> equity) static PortfolioHistoryCreate an instance of PortfolioHistory given an JSON stringReturn the additional (undeclared) property.Return the additional (undeclared) property with the specified name.basis in dollar of the profit loss calculationIf included, then it indicates that the base_value is the account's closing equity value at this trading date.accumulated value in dollar amount as of the end of each time windowequity value of the account in dollar amount as of the end of each time windowprofit/loss in dollar from the base valueprofit/loss in percentage from the base valuetime window size of each data elementTime of each data element, left-labeled (the beginning of time window).inthashCode()profitLoss(List<BigDecimal> profitLoss) profitLossPct(List<BigDecimal> profitLossPct) putAdditionalProperty(String key, Object value) Set the additional (undeclared) property with the specified name and value.voidsetBaseValue(BigDecimal baseValue) voidsetBaseValueAsof(LocalDate baseValueAsof) voidsetCashflow(Object cashflow) voidsetEquity(List<BigDecimal> equity) voidsetProfitLoss(List<BigDecimal> profitLoss) voidsetProfitLossPct(List<BigDecimal> profitLossPct) voidsetTimeframe(String timeframe) voidsetTimestamp(List<Integer> timestamp) toJson()Convert an instance of PortfolioHistory to an JSON stringtoString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_BASE_VALUE
- See Also:
-
SERIALIZED_NAME_BASE_VALUE_ASOF
- See Also:
-
SERIALIZED_NAME_CASHFLOW
- See Also:
-
SERIALIZED_NAME_EQUITY
- See Also:
-
SERIALIZED_NAME_PROFIT_LOSS
- See Also:
-
SERIALIZED_NAME_PROFIT_LOSS_PCT
- See Also:
-
SERIALIZED_NAME_TIMEFRAME
- See Also:
-
SERIALIZED_NAME_TIMESTAMP
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
PortfolioHistory
public PortfolioHistory()
-
-
Method Details
-
baseValue
-
getBaseValue
basis in dollar of the profit loss calculation- Returns:
- baseValue
-
setBaseValue
-
baseValueAsof
-
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
-
cashflow
-
getCashflow
accumulated value in dollar amount as of the end of each time window- Returns:
- cashflow
-
setCashflow
-
equity
-
addEquityItem
-
getEquity
equity value of the account in dollar amount as of the end of each time window- Returns:
- equity
-
setEquity
-
profitLoss
-
addProfitLossItem
-
getProfitLoss
profit/loss in dollar from the base value- Returns:
- profitLoss
-
setProfitLoss
-
profitLossPct
-
addProfitLossPctItem
-
getProfitLossPct
profit/loss in percentage from the base value- Returns:
- profitLossPct
-
setProfitLossPct
-
timeframe
-
getTimeframe
time window size of each data element- Returns:
- timeframe
-
setTimeframe
-
timestamp
-
addTimestampItem
-
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
-
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 PortfolioHistory 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 PortfolioHistory
-
fromJson
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
Convert an instance of PortfolioHistory to an JSON string- Returns:
- JSON string
-