A portfolio model specifies the target weights of a portfolio, along with drift tolerances and cooldown periods.
create_portfolio_model(name, description, cash, assets, tolerance, cooldown)
name of the model
description of the model
cash data frame
assets data frame
percentage by which and symbols is permitted to drift from target weight
number of days after successful rebalance to wait before new rebalance can be triggered
a portfolio model object
name <- "sample_portfolio"
description <- "create from function"
cash <- list(percent = 10)
assets <- data.frame(symbol = c("AAPL","GOOG"), percent = c(80.5,9.5))
tolerance <- list(percent = 5)
cooldown <- list(days = 365)
create_portfolio_model(name = name,
description = description,
cash = cash,
assets = assets,
tolerance = tolerance,
cooldown = cooldown)
#> $name
#> [1] "sample_portfolio"
#>
#> $description
#> [1] "create from function"
#>
#> $cash
#> $cash$percent
#> [1] 10
#>
#>
#> $assets
#> symbol percent
#> 1 AAPL 80.5
#> 2 GOOG 9.5
#>
#> $tolerance
#> $tolerance$percent
#> [1] 5
#>
#>
#> $cooldown
#> $cooldown$days
#> [1] 365
#>
#>
#> $created_at
#> [1] "2024-03-18T19:53:07"
#>
#> $updated_at
#> [1] "2024-03-18T19:53:07"
#>