Skip to contents

Availability-aware runs value every held instrument at a current close, a permissible stale close, or, under ledgr_valuation_stale(exhausted = "freeze"), a frozen close carried beyond max_sessions. Frozen equity is an assumption-backed estimate: cash and quantity are exact, but the frozen mark is not an observed price.

Usage

ledgr_valuation_summary(bt, con = NULL)

# S3 method for class 'ledgr_valuation_summary'
print(x, ...)

Arguments

bt

A ledgr_backtest object.

con

An optional open database connection used internally. Public callers should leave this as NULL.

x

A ledgr_valuation_summary object.

...

Unused.

Value

A list-like ledgr_valuation_summary object.

Details

The summary counts held instrument-sessions valued at stale and frozen closes, the largest frozen gross value and its share of equity, the longest continuous freeze, and what was still frozen at the end of the run. total_return_if_frozen_worthless subtracts the frozen-at-end long value from final equity before computing the endpoint return. It is a bound for the endpoint only; it does not correct Sharpe, volatility, drawdown or the stored equity path. Dense runs have no valuation policy and report valuation_state = "not_applicable".

The summary also records what the run's point-in-time view rested on: universe_kind ("membership" for a membership rule, with its universe_id, or "fixed" for a fixed basket; membership_declared says whether the snapshot declares membership facts a fixed basket does not apply), assumption_backed_families with their assumption_reasons ("knowledge_assume_effective", "generated_schedule", joined by |, as in ledgr_experiment_plan(); equity_corporate_actions is listed when any sealed corporate-action knowledge time was filled known-when-effective), and max_sessions_default, TRUE when the stale-mark horizon (max_sessions) is the ledgr_valuation_stale() default of 5 sessions. print() of a result shows these on one Point in time: line that names the valuation stale-mark horizon as such, followed by a History policy: line with the experiment's ledgr_history_policy() (price carry, output carry and segment limit, each marked default or declared); the stale-mark horizon is a valuation setting, not the history policy's price carry. history_policy holds those three fields as a tibble (setting, label, value, default). summary() lists the same fields with the valuation evidence and a History Policy section.

A run that stopped INCOMPLETE because a holding had no permissible mark (valuation_horizon_exhausted: a holding never priced or, under exhausted = "refuse", a mark older than max_sessions; or terminal_mark_unavailable: a known-inactive holding whose terminal choice needs a mark it lacks) records the stop in valuation_stop_reason, valuation_stop_ts_utc and valuation_stop_instruments (NA, NA and empty otherwise), and the valuation headline of print() and summary() reads STOPPED with the stop pulse, the holdings and the reason. valuation_state still describes the marks of the pulses before the stop.