qis.generate_strategy_factsheet¶
- qis.generate_strategy_factsheet(portfolio_data, benchmark_prices, time_period=None, ytd_attribution_time_period=<qis.utils.dates.TimePeriod object>, weight_report_time_period=None, perf_params=PerfParams(freq='W-WED', freq_vol='W-WED', freq_skewness='ME', freq_drawdown='D', freq_reg='W-WED', freq_excess_return='W-WED', return_type=<ReturnTypes.LOG: 'Log'>, sharpe_convention=<SharpeConvention.PA: 1>, rates_data=None), regime_classifier=<qis.perfstats.regime_classifier.BenchmarkReturnsQuantilesRegime object>, regime_benchmark=None, weights_freq='W-WED', turnover_rolling_period=260, freq_turnover='B', freq_cost='B', cost_rolling_period=260, factor_beta_span=52, freq_beta='W-WED', vol_rolling_window=13, freq_sharpe='B', freq_var='B', var_span=33, sharpe_rolling_window=260, add_benchmarks_to_navs=False, figsize=(8.5, 11.7), fontsize=5, weights_change_lag=20, add_current_position_var_risk_sheet=False, add_grouped_weights_sheet=False, add_current_signal_report=False, add_weight_change_report=False, add_performance_risk_attribution_sheet=False, add_grouped_exposures=False, add_grouped_cum_pnl=False, add_instrument_history_report=False, y_limits_signal=(-1.0, 1.0), is_1y_exposures=False, is_grouped=False, dd_legend_type=DdLegendType.SIMPLE, is_unit_based_traded_volume=None, df_to_add=None, factsheet_name=None, monthly_returns_heatmap_max_years=10, recent_ra_perf_table_start_date=Timestamp('2020-12-31 00:00:00'), turnover_computation_type=None, turnover_vols=None, *, add_drawdown_analysis_sheet=True, benchmark_drawdown_min_depth=0.1, benchmark_drawdown_windows=None, add_performance_inference_sheet=True, alpha_inference=InterceptInference.BARTLETT_HAC, alpha_coverage=None, group_data=None, lookthrough_matrix=None, **kwargs)[source]¶
multi-page factsheet for one strategy against a benchmark.
The strategy archetype behind
qis.factsheet(). Page one always renders: cumulative performance with regime shading, risk-adjusted performance tables, rolling volatility, Sharpe and beta, drawdowns, exposures, turnover and costs. Theadd_*flags each append a further page. The inference appendix and the final drawdown analysis page are on by default. Each has its own opt-out.The parameters group as: data; reporting windows; statistics configuration; per-panel frequencies and rolling windows; optional extra sheets; layout; naming. The per-panel frequencies exist because the panels do not share a grid — drawdowns are read on the native business-day path while betas are read weekly — and each panel states the frequency it was computed at.
- Parameters:
alpha_coverage (HoldingsAlphaCoverage | None) – Optional explicit tiny-weight/proxy policy for holdings alpha. None keeps strict coverage. Enabled policies append coverage/excluded-date audit pages without changing beta warm-up, Sharpe, page one or portfolio NAV.
alpha_inference (InterceptInference) – Primary alpha uncertainty method. Bartlett HAC remains the default; PREWHITENED_AR1 is opt-in. Both use the same eligible sample and lag count, with the alternate shown as unadjusted sensitivity only. Does not change Sharpe or page one.
add_drawdown_analysis_sheet (bool) – Append the strategy and benchmark drawdown page last.
benchmark_drawdown_min_depth (float) – Absolute benchmark loss cutoff; default strictly over 10%.
benchmark_drawdown_windows (dict[str, TimePeriod] | None) – Optional named observed benchmark peak/trough date pairs expressed as TimePeriod objects within the report span.
add_performance_inference_sheet (bool) – Append two-column arithmetic-Sharpe and holdings-alpha diagnostics after the monthly full-history appendix, if present. Defaults to True. Sharpe uses perf_params.freq_vol; alpha uses freq_beta/factor_beta_span and only the first benchmark, lagged holdings betas and existing cash rates. Windows need >=24 returns and two observation-equivalent years; HAC also needs N>=5(L+1). Quarterly rolling history uses six years; other grids use five years with a three/two-year fallback warning. Missing, short or undefined samples stay unavailable.
lookthrough_matrix (DataFrame | None) – Optional static instrument-by-sleeve fractions. Supplied rows are finite, nonnegative and sum to one; omitted rows use group_data. None preserves categorical reporting. This is an accounting split.
group_data (Series | None) – Ordinary instrument labels as a Series; defaults to portfolio metadata where available. Fractional memberships belong in lookthrough_matrix.
portfolio_data (PortfolioData) – the strategy; must carry weights and instrument pnl for the attribution panels, and
covar_dictfor the risk panelsbenchmark_prices (DataFrame | Series) – benchmark panel for the regressions and regime classification
time_period (TimePeriod) – reporting span; defaults to the full nav history
recent_ra_perf_table_start_date (Timestamp | None) – start of the second risk-adjusted performance table. Defaults to 31 December 2020; None uses the trailing year
ytd_attribution_time_period (TimePeriod) – span of the year-to-date attribution panel
weight_report_time_period (TimePeriod) – span of the weights panel, when it should differ from the report span
perf_params (PerfParams) – sampling frequencies and Sharpe convention for the performance tables
regime_classifier (BenchmarkReturnsQuantilesRegime) – how the benchmark history is cut into regimes
regime_benchmark (str) – which benchmark column drives the regimes; defaults to the first
weights_freq (str | None) – sampling of the exposures panel
turnover_rolling_period (int) – window of the rolling turnover panel, in periods of
freq_turnoverfreq_turnover (str) – grid the turnover panel is computed on
freq_cost (str) – grid the realised-cost panel is computed on
cost_rolling_period (int) – window of the rolling cost panel
factor_beta_span (int) – EWM span of the rolling beta, in periods of
freq_betafreq_beta (str) – grid the rolling beta is computed on
vol_rolling_window (int) – window of the rolling volatility panel
freq_sharpe (str) – grid the rolling Sharpe is computed on
freq_var (str) – grid the value-at-risk panel is computed on
var_span (float) – EWM span for the value-at-risk estimate
sharpe_rolling_window (int) – window of the rolling Sharpe panel
add_benchmarks_to_navs (bool) – show the benchmarks alongside the strategy in the performance panels rather than only as the regression reference
figsize (Tuple[float, float]) – page size in inches; the default is A4 portrait
fontsize (int) – base font size
monthly_returns_heatmap_max_years (int | None) – maximum calendar-year rows shown on the summary page. Longer histories emit a warning and add an adaptive full-history portrait page. None keeps the complete history on the summary page and disables the appendix
weights_change_lag (int) – lookback for the weight-change report, in periods
add_current_position_var_risk_sheet (bool) – append current positions with their value-at-risk
add_grouped_weights_sheet (bool) – append weights aggregated by
group_dataadd_current_signal_report (bool) – append the current signal state; needs
strategy_signal_dataadd_weight_change_report (bool) – append weight changes over
weights_change_lagadd_performance_risk_attribution_sheet (bool) – append performance and risk attribution
add_grouped_exposures (bool) – append exposures aggregated by group
add_grouped_cum_pnl (bool) – append cumulative pnl aggregated by group
add_instrument_history_report (bool) – append per-instrument history
y_limits_signal (Tuple[float | None, float | None]) – y limits of the signal panel
is_1y_exposures (bool) – restrict the exposures panel to the trailing year
is_grouped (bool) – aggregate the panels by
group_datawhere the panel supports itdd_legend_type (DdLegendType) – how much detail the drawdown legend carries
turnover_computation_type (TurnoverComputationType | None) – turnover convention; None uses the portfolio default
turnover_vols (DataFrame | None) – annualized volatility panel for volatility-normalized weight turnover
is_unit_based_traded_volume (bool | None) – deprecated turnover selector retained for compatibility; it still controls whether costs are normalized by NAV
df_to_add (DataFrame) – extra frame appended as a table
factsheet_name (str) – report title
**kwargs – forwarded to the underlying plot functions.
asset_tail_countis 10 (default) or 20 per side. Large asset panels show both tails by the displayed metric; additive panels retain an Other remainder and full portfolio totals
- Returns:
one figure per page, in page order
- Return type: