qis.MultiAssetsReport¶
- class qis.MultiAssetsReport(prices, benchmark_prices, 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>)[source]¶
Bases:
object- Parameters:
prices (DataFrame)
perf_params (PerfParams)
regime_classifier (BenchmarkReturnsQuantilesRegime)
- __init__(prices, benchmark_prices, 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>)[source]¶
- Parameters:
prices (DataFrame)
perf_params (PerfParams)
regime_classifier (BenchmarkReturnsQuantilesRegime)
Methods
__init__(prices, benchmark_prices[, ...])add_regime_shadows(ax, regime_benchmark, data_df)get_prices([benchmark, ...])plot_annual_returns([...])plot_benchmark_alpha_attribution(benchmark)plot_benchmark_beta(benchmark[, freq_beta, ...])plot rolling beta to one benchmark
plot_corr_table([corr_freq, ...])plot_drawdowns([regime_benchmark, ...])plot_nav([regime_benchmark, ...])plot_performance_bars([time_period, ...])plot_ra_perf_table(benchmark[, ...])plot_ra_regime_table([regime_benchmark, ...])plot table with bear/normal/bull sharpes
plot_regime_data(benchmark[, ...])plot_returns_scatter(benchmark[, ...])plot_rolling_perf([rolling_perf_stat, ...])plot_vol_regimes(benchmark[, time_period, ...])- get_prices(benchmark=None, add_benchmarks_to_navs=False, time_period=None)[source]¶
- Parameters:
benchmark (str)
add_benchmarks_to_navs (bool)
time_period (TimePeriod)
- Return type:
- add_regime_shadows(ax, regime_benchmark, data_df, time_period=None, regime_classifier=None)[source]¶
- Parameters:
ax (Axes)
regime_benchmark (str)
data_df (DataFrame)
time_period (TimePeriod)
regime_classifier (BenchmarkReturnsQuantilesRegime)
- Return type:
None
- plot_ra_perf_table(benchmark, add_benchmarks_to_navs=False, time_period=None, perf_columns=(PerfStat.P.a. return, PerfStat.Vol, PerfStat.Sharpe (rf=0), PerfStat.Max DD, PerfStat.Skewness, PerfStat.An Alpha, PerfStat.Beta, PerfStat.R2, PerfStat.p-Alpha), perf_params=None, title=None, ax=None, **kwargs)[source]¶
- Parameters:
benchmark (str)
add_benchmarks_to_navs (bool)
time_period (TimePeriod)
perf_params (PerfParams)
title (str | None)
ax (Axes)
- Return type:
None
- plot_ra_regime_table(regime_benchmark=None, time_period=None, perf_columns=(PerfStat.Total, PerfStat.P.a. return, PerfStat.Vol, PerfStat.Sharpe (rf=0), PerfStat.Bear-Sharpe, PerfStat.Normal-Sharpe, PerfStat.Bull-Sharpe, PerfStat.Max DD, PerfStat.Max DD/Vol, PerfStat.Worst, PerfStat.Best, PerfStat.Skewness, PerfStat.Kurtosis), columns_title='Programs', first_column_width=3.5, ax=None, **kwargs)[source]¶
plot table with bear/normal/bull sharpes
- Parameters:
regime_benchmark (str)
add_benchmarks_to_navs (bool)
var_format (str)
sharpe_format (str)
title (str)
is_log (bool)
time_period (TimePeriod)
perf_params (PerfParams)
ax (Axes)
- Return type:
None
- plot_drawdowns(regime_benchmark=None, add_benchmarks_to_navs=True, time_period=None, dd_legend_type=DdLegendType.SIMPLE, title='Running Drawdowns', ax=None, **kwargs)[source]¶
- Parameters:
regime_benchmark (str)
add_benchmarks_to_navs (bool)
time_period (TimePeriod)
dd_legend_type (DdLegendType)
title (str)
ax (Axes)
- Return type:
None
- plot_rolling_time_under_water(regime_benchmark=None, time_period=None, dd_legend_type=DdLegendType.SIMPLE, title='Running Time Under Water', ax=None, **kwargs)[source]¶
- Parameters:
regime_benchmark (str)
time_period (TimePeriod)
dd_legend_type (DdLegendType)
title (str)
ax (Axes)
- Return type:
None
- plot_annual_returns(add_benchmarks_to_navs=False, heatmap_freq='YE', date_format='%Y', time_period=None, table_fontsize=4, title=None, ax=None, **kwargs)[source]¶
- plot_corr_table(corr_freq='W-WED', add_benchmarks_to_navs=True, time_period=None, ax=None, **kwargs)[source]¶
- Parameters:
corr_freq (str)
add_benchmarks_to_navs (bool)
time_period (TimePeriod)
ax (Axes)
- Return type:
None
- plot_returns_scatter(benchmark, time_period=None, freq='QE', order=2, ax=None, **kwargs)[source]¶
- Parameters:
benchmark (str)
time_period (TimePeriod)
freq (str)
order (int)
ax (Axes)
- Return type:
None
- plot_benchmark_beta(benchmark, freq_beta='ME', factor_beta_span=12, time_period=None, ax=None, **kwargs)[source]¶
plot rolling beta to one benchmark
- Parameters:
benchmark (str)
freq_beta (str)
factor_beta_span (int)
time_period (TimePeriod)
ax (Axes)
- Return type:
None
- plot_benchmark_alpha_attribution(benchmark, freq_beta='ME', factor_beta_span=12, factor_alpha_title=None, time_period=None, ax=None, **kwargs)[source]¶
- plot_rolling_perf(rolling_perf_stat=RollingPerfStat.SHARPE, regime_benchmark=None, time_period=None, sharpe_rolling_window=756, freq_sharpe=None, legend_stats=LegendStats.FIRST_AVG_LAST, ax=None, **kwargs)[source]¶
- Parameters:
rolling_perf_stat (RollingPerfStat)
regime_benchmark (str)
time_period (TimePeriod)
sharpe_rolling_window (int)
freq_sharpe (str | None)
legend_stats (LegendStats)
ax (Axes)
- Return type:
- plot_regime_data(benchmark, regime_data_to_plot=RegimeData.REGIME_SHARPE, time_period=None, var_format=None, is_conditional_sharpe=True, drop_benchmark=False, title=None, legend_loc='upper center', perf_params=None, regime_classifier=None, ax=None, **kwargs)[source]¶
- Parameters:
benchmark (str)
regime_data_to_plot (RegimeData)
time_period (TimePeriod)
var_format (str | None)
is_conditional_sharpe (bool)
drop_benchmark (bool)
title (str)
legend_loc (str | None)
perf_params (PerfParams)
regime_classifier (RegimeClassifier)
ax (Axes)
- Return type:
None
- plot_vol_regimes(benchmark, time_period=None, title=None, ax=None, **kwargs)[source]¶
- Parameters:
benchmark (str)
time_period (TimePeriod)
title (str)
ax (Axes)
- Return type:
None