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, andplot_df_table(), which renders text: each statistic is formatted with the format itsPerfStatmember 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 notPerfParams(), so a regular business-day index gives a daily volatility. Pass an explicit PerfParams for reproducible gridsperf_columns (List[PerfStat]) – statistics to include, in column order. Only columns that
compute_ra_perf_table()produces are returned; the regression columns of theBENCHMARK_*andLN_BENCHMARK_*presets and the regime Sharpe columns ofSD_PERF_COLUMNSare skipped without a warning. Useplot_ra_perf_table_benchmark()orcompute_bnb_regimes_pa_perf_table()for thosecolumn_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: