Skip to contents

passed_warmup() is a strategy-authoring guard for named numeric vectors returned by ctx$features(id, feature_map). For those vectors, TRUE means every requested feature is usable at the current pulse. For arbitrary vectors, it is only an all(!is.na(x)) predicate.

Usage

passed_warmup(x)

Arguments

x

A numeric vector, typically returned by ctx$features().

Value

A logical scalar.

Details

passed_warmup() is not a signal pipeline transformation. It is a guard for strategy conditions after feature values have been read. Zero-length input aborts with classes ledgr_empty_warmup_input and ledgr_invalid_warmup_input; non-numeric input aborts with class ledgr_invalid_warmup_input.

Articles

Feature-map strategy authoring is taught in:

vignette("strategy-development", package = "ledgr") system.file("doc", "strategy-development.html", package = "ledgr")

Indicator warmup is covered in:

vignette("indicators", package = "ledgr") system.file("doc", "indicators.html", package = "ledgr")

Examples

passed_warmup(c(ret_5 = NA_real_, sma_10 = 101))
#> [1] FALSE
passed_warmup(c(ret_5 = 0.02, sma_10 = 101))
#> [1] TRUE

try(passed_warmup(numeric(0)))
#> Error in passed_warmup(numeric(0)) : 
#>   `x` must contain at least one feature value.