Computation of all the transaction updates and the realized and paper gains and losses for each assets.
portfolio_compute( portfolio_transactions, market_prices, method = "count", allow_short = TRUE, time_threshold = "0 mins", exact_market_prices = TRUE, portfolio_driven_DE = FALSE, time_series_DE = FALSE, assets_time_series_DE = NULL, verbose = c(0, 0), progress = FALSE )
Data frame. The investor's transactions data frame.
Data frame containing the market prices.
Character string containing the method to use to compute realized and paper gains and losses. If "none" nothing is computed but the investor's portfolio updates. Otherwise it has to be one of "count" (default), "total", "value", "duration", or "all".
Logical. If TRUE short positions are allowed, otherwise only long positions are allowed.
Character in the format "value units" indicating the
time threshold at which the computed financial difftime has to be evaluated
(for instance "05 mins" or "20 hours").
The allowed units are "secs", "mins", "hours", "days" and "weeks"
Logical. If TRUE then
Logical. If TRUE the realized and paper gains and
losses for the positive (that is when the investor's portfolio value, as
Logical. If TRUE the time series of disposition effect is computed on 'count' and 'value' methods only.
Character vector of assets' names as contained
Numeric or logical vector of length 2 that allows to control for the function's verbosity.
Logical. If TRUE a progress bar is displayed.
A data frame containing the investor's portfolio and the values of realized and paper gains and losses computed by means of the chosen method on each portfolio assets.
If time_series_DE is set to TRUE, then also time series disposition effect results are returned.