| run_walk_forward | R Documentation |
Runs rolling IS/OOS optimization, reselects params each window, and backtests OOS performance (optionally with warmup tails).
run_walk_forward(
prices,
grid,
builder,
metric = NULL,
is_periods = 52,
oos_periods = 13,
step = NULL,
warmup_periods = 0,
verbose = FALSE,
light_mode = TRUE,
precompute_all = TRUE,
builder_args = list(),
n_cores = 1
)
prices |
Data frame with Date column and symbol columns |
grid |
Data frame OR named list; each row/combination is a parameter set |
builder |
Function(prices, params, ...) -> weights data.frame (Date + assets) |
metric |
Function(backtest_result) -> scalar score (higher is better).
Defaults to |
is_periods |
Integer, number of in-sample periods |
oos_periods |
Integer, number of out-of-sample periods |
step |
Integer, step size for rolling windows (default = oos_periods) |
warmup_periods |
Integer, warmup periods appended before each OOS |
verbose |
Logical, print progress |
light_mode |
Logical, passed to run_param_grid (kept for compatibility) |
precompute_all |
Logical, precompute indicators once and slice per window |
builder_args |
List, extra args passed to builder (e.g., indicator_cache) |
n_cores |
Integer (kept for API compatibility; ignored here) |
An object of class wf_optimization_result.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.