Skip to contents

ledgr_signal_feature() reads one already-registered feature plane and returns one raw score per instrument in ctx$universe, in that order. The signal carries ctx$vec$admissible as its eligible attribute: an instrument that is not a member, or is target-restricted, keeps its raw score but is marked ineligible, so ineligible is never reported as missing. ledgr_select_top_n() ranks eligible scores only, and ledgr_selection() decides eligible instruments only.

Usage

ledgr_signal_feature(ctx, feature_id)

Arguments

ctx

ledgr strategy context.

feature_id

One non-empty active feature-map alias or registered feature ID. The supplied name is retained as the signal origin.

Value

A ledgr_signal object.

Details

Arithmetic on a signal keeps its class and eligible attribute; comparison, subsetting, rank() and c() return plain vectors. Use ledgr_signal() with its values entrance to turn a transformed vector back into a signal.

Articles

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

Examples

ctx <- list(
  universe = c("AAA", "BBB"),
  availability_active = FALSE,
  vec = list(
    feature = function(feature_id) c(AAA = 0.03, BBB = NA_real_)
  )
)
ledgr_signal_feature(ctx, "return_5")
#> <ledgr_signal> [2 assets]
#> origin: return_5
#> non-NA: 1/2
#>  AAA  BBB 
#> 0.03   NA