Skip to contents

ledgr_signal() creates a named numeric score vector for strategy helper pipelines. Signals are intermediate objects; strategies must not return them directly. A zero-length named signal represents an empty decision domain.

Usage

ledgr_signal(x, universe = NULL, origin = NULL, ...)

Arguments

x

Named numeric vector of signal scores, or a pulse context.

universe

Optional universe used to reject extra instrument names.

origin

Optional helper/source label for printing.

...

In context mode, exactly one named values payload.

Value

A ledgr_signal object.

Details

In context mode, ledgr_signal(ctx, values = ...) returns one value per instrument in ctx$universe and carries ctx$vec$admissible as its eligible attribute. Unnamed values align by position and must have one value per instrument; named values may come in any order and must cover every eligible instrument, and uncovered instruments are NA.

Articles

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

Examples

ledgr_signal(c(AAA = 0.03, BBB = NA_real_), origin = "return_5")
#> <ledgr_signal> [2 assets]
#> origin: return_5
#> non-NA: 1/2
#>  AAA  BBB 
#> 0.03   NA