Skip to contents

These helpers keep feature-materialization parameters and strategy-runtime parameters in separate namespaces before composing executable sweep candidates. They are the canonical authoring path for sweeps that vary ledgr-owned indicator parameters behind active aliases.

Usage

ledgr_feature_grid(..., .filter = NULL)

ledgr_strategy_grid(..., .filter = NULL)

ledgr_grid_cross(features, strategy)

ledgr_grid_named(...)

ledgr_grid_add_baseline(grid, ...)

Arguments

...

Named grid columns for ledgr_feature_grid() and ledgr_strategy_grid(), or named executable candidate specs for ledgr_grid_named() / ledgr_grid_add_baseline().

.filter

Optional narrow filter expression evaluated against generated grid columns.

features

A ledgr_feature_grid object. Omitted to use one empty feature-parameter row.

strategy

A ledgr_strategy_grid object or an ordinary rectangular data frame with one strategy-parameter candidate per row. Omitted to use one empty strategy-parameter row.

grid

A ledgr_executable_grid object.

Value

A grid object.

Examples

fg <- ledgr_feature_grid(fast_n = c(10L, 20L), slow_n = 40L, .filter = fast_n < slow_n)
sg <- ledgr_strategy_grid(qty = c(50L, 100L))
grid <- ledgr_grid_cross(features = fg, strategy = sg)
grid
#> ledgr_executable_grid
#> =====================
#> Candidates: 4
#> Labels:     feature_fa560ccbec9f/strategy_a5bda8b0d38f, feature_fa560ccbec9f/strategy_b8db30e35cac, feature_9f9d160d8a33/strategy_a5bda8b0d38f, feature_9f9d160d8a33/strategy_b8db30e35cac

ledgr_grid_add_baseline(
  grid,
  flat = list(feature = list(fast_n = 10L, slow_n = 40L), strategy = list(qty = 0L))
)
#> ledgr_executable_grid
#> =====================
#> Candidates: 5
#> Labels:     feature_fa560ccbec9f/strategy_a5bda8b0d38f, feature_fa560ccbec9f/strategy_b8db30e35cac, feature_9f9d160d8a33/strategy_a5bda8b0d38f, feature_9f9d160d8a33/strategy_b8db30e35cac, flat