# \donttest{
data(sample_prices_weekly)
b <- function(prices, params, ...) {
weight_equally(filter_top_n(calc_momentum(prices, params$lookback),
params$top_n))
}
wf <- run_walk_forward(
prices = sample_prices_weekly,
grid = list(lookback = c(8, 12, 26), top_n = c(5, 10)),
builder = b,
is_periods = 52, oos_periods = 26, step = 26
)
plot(wf, type = "parameters")
plot(wf, type = "is_oos", metric = "OOS_Score")
# }
Run the code above in your browser using DataLab