Skip to contents

ledgr_pulse_wide() returns one row for a pulse. It includes pulse metadata, portfolio state, per-instrument OHLCV columns, and per-instrument feature columns. OHLCV columns use {instrument_id}__ohlcv_{field}. Feature columns use {instrument_id}__feature_{feature_id}. The delimiter __ is reserved for this naming contract and must not appear in instrument IDs or feature IDs used in the wide output. A feature map filters and orders feature columns but does not rename them to aliases.

Usage

ledgr_pulse_wide(pulse, feature_map = NULL)

Arguments

pulse

A ledgr_pulse_context.

feature_map

Optional ledgr_feature_map. Filters and orders feature columns; does not rename them to aliases.

Value

A one-row tibble with ts_utc, cash, equity, one OHLCV block per instrument, and feature columns for the requested pulse.

Articles

Indicators, feature IDs, and pulse feature views:

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

Examples

ledgr_pulse_wide(pulse, features)
#> # A tibble: 1 × 9
#>   ts_utc                cash equity AAA__ohlcv_open AAA__ohlcv_high
#>   <dttm>               <dbl>  <dbl>           <dbl>           <dbl>
#> 1 2020-01-03 00:00:00 100000 100000             102             103
#> # ℹ 4 more variables: AAA__ohlcv_low <dbl>, AAA__ohlcv_close <dbl>,
#> #   AAA__ohlcv_volume <dbl>, AAA__feature_sma_2 <dbl>