Load portfolio targets

load_portfolio_targets(portfolio, portfolio_model)

Arguments

portfolio

a portfolio object, as returned from get_portfolio_current()

portfolio_model

a portfolio model, as returned from read_portfolio_model() or create_portfolio_model()

Value

an extended portfolio object which can be passed to price_portfolio()

Examples

if (FALSE) {
t_conn <- alpaca_connect('paper',
                         Sys.getenv("ALPACA_PAPER_KEY"),
                         Sys.getenv("ALPACA_PAPER_SECRET"))

portfolio_model <- read_portfolio_model(system.file(package='rblncr','extdata/sample_portfolio.yaml'))

get_portfolio_current(t_conn) |>
  load_portfolio_targets(portfolio_model)
}