portfolio_compute {dispositionEffect} | R Documentation |
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
)
portfolio_transactions |
Data frame. The investor's transactions data frame. |
market_prices |
Data frame containing the market prices. |
method |
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". |
allow_short |
Logical. If TRUE short positions are allowed, otherwise only long positions are allowed. |
time_threshold |
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"
(See |
exact_market_prices |
Logical. If TRUE then |
portfolio_driven_DE |
Logical. If TRUE the realized and paper gains and
losses for the positive (that is when the investor's portfolio value, as
computed through |
time_series_DE |
Logical. If TRUE the time series of disposition effect is computed on 'count' and 'value' methods only. |
assets_time_series_DE |
Character vector of assets' names as contained
into |
verbose |
Numeric or logical vector of length 2 that allows to control for the function's verbosity. |
progress |
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.
realized_compute
, paper_compute
,
gains_losses