realized_compute {dispositionEffect}R Documentation

Realized estimation

Description

Compute realized gains and realized losses as either simple counts, total quantities, expected returns and financial duration.

Usage

realized_count(
  portfolio_quantity,
  portfolio_price,
  transaction_quantity,
  transaction_price,
  transaction_type,
  allow_short = TRUE,
  realized_only = FALSE
)

realized_total(
  portfolio_quantity,
  portfolio_price,
  transaction_quantity,
  transaction_price,
  transaction_type,
  allow_short = TRUE,
  realized_only = FALSE
)

realized_value(
  portfolio_quantity,
  portfolio_price,
  transaction_quantity,
  transaction_price,
  transaction_type,
  allow_short = TRUE,
  realized_only = FALSE
)

realized_duration(
  portfolio_quantity,
  portfolio_price,
  transaction_quantity,
  transaction_price,
  transaction_type,
  previous_transaction_datetime,
  previous_datetime,
  transaction_datetime,
  allow_short = TRUE,
  realized_only = FALSE
)

realized_compute(
  portfolio_quantity,
  portfolio_price,
  transaction_quantity,
  transaction_price,
  transaction_type,
  previous_transaction_datetime,
  previous_datetime,
  transaction_datetime,
  transaction_asset,
  allow_short = TRUE,
  realized_only = FALSE,
  method = "all"
)

realized_empty(transaction_asset, method = "all")

Arguments

portfolio_quantity

Numeric vector. The portfolio quantities of assets into the investor's portfolio.

portfolio_price

Numeric vector. The portfolio prices of assets into the investor's portfolio.

transaction_quantity

Numeric value. The quantity of the traded asset.

transaction_price

Numeric value. The market price of the traded asset.

transaction_type

Character string. Either "B" = buy or "S" = sell.

allow_short

Logical. If TRUE short positions are allowed, otherwise only long positions are allowed.

realized_only

Logical. If TRUE only realized gains and realized losses are computed. Otherwise also paper gains and paper losses on excess quantity of the traded asset are computed.

previous_transaction_datetime

POSIXct value. The portfolio date-time related to the last transaction of the traded asset.

previous_datetime

POSIXct value. The date-time of the last transaction performed by the investor.

transaction_datetime

POSIXct value. The date-time at which the transaction is going to occur.

transaction_asset

Character string. The name of the traded asset.

method

Character string. The method used to compute papers. Allowed values are "count", "total", "value", "duration" and "all".

Value

The described functions have different return behaviors

In particular:

Functions

See Also

paper_compute, gains_losses


[Package dispositionEffect version 1.0.1 Index]