compute_prices_from_relatives: get prices from price relatives

Description Usage Arguments Value Functions

View source: R/portfolio_utils.R

Description

Given price_relatives and the initial prices, get the actual prices

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
compute_prices_from_relatives(
  price_relatives,
  initial_price,
  .check_input = TRUE
)

compute_price_matrix_from_relatives(
  price_relative_matrix,
  initial_prices,
  .check_input = TRUE
)

Arguments

price_relatives

a vector of price relatives where each entry represents the price relative for a trading period, i.e. price relative x_t = p_{t+1} / p_t.

initial_price

p_1, the initial price.

.check_input

If TRUE, checks that input meets the given assumptions.

price_relative_matrix

a matrix of price relatives, each row representing a trading period and each column an asset. A price relative is p_{t+1} / p_t, i.e. the ratio of trading price to next price. Prices change according to the price relatives after the trade, i.e. the price relatives for the trading period are not known at trading time

initial_prices

A vector holding the initial prices of each asset i

transaction_rate

The percentage of each transaction (buy and sell) spent on broker fees

Value

A vector with one more entry than price_relatives representing the true prices of the assets, the ith entry being the price during trading in period i, immediately before the price changes represent by price relatives i take place.

Functions


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