display_perf¶
Defined in fynance.backtest
- display_perf(y_idx, y_est, period=252, title='', params_iv={}, plot_drawdown=True, plot_roll_sharpe=True, x_axis=None, underlying='Underlying', win=252, fees=0)[source]
Plot performance and print KPI of backtest.
Print dynamic plot of performance indicators (perf, rolling sharpe and draw down) of a strategy (raw and iso-volatility) versus its underlying.
- Parameters:
- y_idxnp.ndarray[np.float64, ndim=1]
Time series of log-returns of the underlying.
- y_estnp.ndarray[np.float64, ndim=1]
Time series of the signal’s strategy.
- periodint, optional
Number of period per year. Default is 252.
- titlestr or list of str, optional
Title of performance strategy, default is empty.
- plot_drawdownbool, optional
If true plot drawdowns, default is True.
- plot_roll_sharpebool, optional
If true plot rolling sharpe ratios, default is True.
- x_axislist or np.asarray, optional
x-axis to plot (e.g. list of dates).
- underlyingstr, optional
Name of the underlying, default is ‘Underlying’.
- winint, optional
Size of the window of rolling sharpe, default is 252.
- feesfloat, optional
Fees to apply at the strategy performance.
- Returns:
- perf_idxnp.ndarray[np.float64, ndim=1]
Time series of underlying performance.
- perf_estnp.ndarray[np.float64, ndim=1]
Time series of raw strategy performance.
- perf_ivonp.ndarray[np.float64, ndim=1]
Time series of iso-vol strategy performance.
See also
PlotBackTest,set_text_stats