qis.compute_benchmark_drawdown_events¶
- qis.compute_benchmark_drawdown_events(strategy_nav, benchmark_nav, min_depth=0.1, named_windows=None)[source]¶
Return simple peak-to-trough and peak-to-recovery returns on benchmark dates.
- Parameters:
strategy_nav (Series) – Observed positive strategy levels. An absent endpoint leaves that strategy return missing, without changing the benchmark event or the other return.
benchmark_nav (Series) – Observed positive reference levels. Missing quotes are omitted before episode detection. Restrict both inputs to the reporting span before calling.
min_depth (float) – Positive loss magnitude in [0, 1). Only strictly deeper events qualify (ignoring floating-point roundoff at equality).
named_windows (Mapping[str, TimePeriod] | None) – Optional labels mapped to observed benchmark peak and trough dates. These replace automatic episodes. The trough must be a minimum and the peak a maximum of its supplied window. Recovery is the first subsequent observed level at or above that local peak, within the supplied sample.
- Returns:
Events sorted by depth then peak date. Dates are benchmark observations. For an open event, end is the latest benchmark date and recovery and recovery returns are missing. All four return columns are unannualised decimal simple returns.
- Return type: