qis.get_ra_perf_columns

qis.get_ra_perf_columns(prices, perf_params=None, perf_columns=(PerfStat.Start date, PerfStat.End date, PerfStat.P.a. return, PerfStat.Vol, PerfStat.Sharpe (rf=0), PerfStat.Max DD, PerfStat.Max DD/Vol, PerfStat.Skewness, PerfStat.Kurtosis), column_header='Asset', df_to_add=None, is_to_str=True, **kwargs)[source]

risk-adjusted performance statistics as a table of formatted strings, ready to render.

The bridge between compute_ra_perf_table(), which computes numbers, and plot_df_table(), which renders text: each statistic is formatted with the format its PerfStat member carries, so percent, ratio and date columns display correctly without the caller restating the convention.

Parameters:
  • prices (DataFrame | Series) – price levels, one column per asset. A Series is promoted to a one-column frame

  • perf_params (PerfParams) – annualisation, frequency and rate conventions. None is passed on to compute_ra_perf_table(), which infers the frequency from the index, PerfParams(freq=pd.infer_freq(prices.index)); it is not PerfParams(), so a regular business-day index gives a daily volatility. Pass an explicit PerfParams for reproducible grids

  • perf_columns (List[PerfStat]) – statistics to include, in column order. Only columns that compute_ra_perf_table() produces are returned; the regression columns of the BENCHMARK_* and LN_BENCHMARK_* presets and the regime Sharpe columns of SD_PERF_COLUMNS are skipped without a warning. Use plot_ra_perf_table_benchmark() or compute_bnb_regimes_pa_perf_table() for those

  • column_header (str) – header of the leading column, which holds the asset names

  • df_to_add (DataFrame) – extra columns inserted before the statistics, for group labels or weights. Complete, uniquely labeled asset rows are aligned by label; other schemas retain their existing positional handling and length checks

  • is_to_str (bool) – format the values as strings. False returns the numbers, for further computation

Returns:

one row per asset, columns named by the display names of the produced perf_columns

Return type:

DataFrame