Run Parameter Grid Optimization (safe + ergonomic)
run_param_grid(
prices,
grid,
builder,
metric = NULL,
name_prefix = "Strategy",
verbose = FALSE,
light_mode = TRUE,
precompute_returns = TRUE,
builder_args = list(),
n_cores = 1,
fixed = NULL
)param_grid_result
Data frame with Date + symbol columns
Data frame (each row = a combo) OR a named list of vectors
Function(prices, params, ...) -> weights (Date + symbols)
Scoring function(backtest) -> numeric. Defaults to metric_sharpe.
String prefix for backtest names
Logical
Logical: speed-ups in backtest
Logical: precompute log-returns once (light_mode only)
List of extra args forwarded to builder (e.g., caches)
Integer (kept for API compatibility; ignored here)
Optional named list of constant parameters merged into every combo.
If a name appears in both grid and fixed, the fixed value wins and that
column is pruned from the grid (fewer duplicate combos; clearer counts).