Skip to contents

Adapt an R package function into a ledgr indicator

Usage

ledgr_adapter_r(pkg_fn, id, requires_bars, ...)

Arguments

pkg_fn

R function (or "pkg::fn" string) to adapt.

id

Indicator identifier.

requires_bars

Minimum lookback period.

...

Additional arguments passed to the package function.

Value

A ledgr_indicator object.

Articles

Indicators, feature IDs, and warmup: vignette("indicators", package = "ledgr") system.file("doc", "indicators.html", package = "ledgr")

Custom indicators and external feature inputs: vignette("custom-indicators", package = "ledgr") system.file("doc", "custom-indicators.html", package = "ledgr")

Examples

median_close <- ledgr_adapter_r(stats::median, id = "median_close", requires_bars = 3)
median_close$id
#> [1] "median_close"