get_return_from_trade: Return the factor by which wealth increases

Description Usage Arguments Value Note

View source: R/portfolio_utils.R

Description

For given price relatives from trading period (t-1)->t, two portfolios (before and after a trade) at times t-1 and a transaction rate, return the factor by which total wealth increases from time t-1 to time t

Usage

1
2
3
4
5
6
7
8
9
get_return_from_trade(
  tp_price_relatives,
  transaction_rate,
  prev_portfolio,
  portfolio,
  tol = 1e-10,
  maxit = 15,
  .check_input = TRUE
)

Arguments

tp_price_relatives

A numeric vector whose ith entry is the price relative for asset i, i.e. its price at the new trading period divided by its price at the previous trading period

transaction_rate

The transaction rate: a scalar in [0,1] which represents the percentage of any stock transaction (buying and selling) which goes towards transaction costs.

prev_portfolio

The portfolio during the previous trading period before the trade

portfolio

The portfolio during the previous trading period after the trade

tol

We guarantee the trade is chosen so that the portfolio matches the argument portfolio within this tolerance (we have to iterate to reach a solution, since the trade is defined implicitly, see the comments inside the function) @param maxit Stops after maxit iterations in used in computing a trade @inheritParams compute_prices_from_relatives

Value

A numeric scalar representing the factor by which wealth increases, i.e. if S_t is wealth at trading period t, returns \frac{S_t}{S_{t-1}},

Note

both portfolios are numeric vectors whose ith entry represents the proportion of total wealth in asset i during the trading period t-1


benSepanski/pfselect documentation built on May 1, 2020, 1:57 p.m.