ezyquant.report.SETBacktestReport#

class ezyquant.report.SETBacktestReport(initial_capital: float, pct_commission: float, pct_buy_slip: float, pct_sell_slip: float, cash_series: Series, position_df: DataFrame, trade_df: DataFrame)#

SETBacktestReport.

Parameters:
  • initial_capital (float) – initial capital.

  • pct_commission (float) – percent commission.

  • pct_buy_slip (float) – percent of buy price increase.

  • pct_sell_slip (float) – percent of sell price decrease.

  • cash_series (pd.Series) – series of cash.

  • position_df (pd.DataFrame) –

    dataframe of position.
    • timestamp

    • symbol

    • volume

    • cost_price

  • trade_df (pd.DataFrame) –

    dataframe of trade.
    • matched_at

    • symbol

    • volume

    • price

    • pct_commission

SETBacktestReport.to_basic([with_dividend, ...])

Calculate performance metrics and generate visualizations for a given strategy.

SETBacktestReport.to_excel(path)

Export to Excel.

SETBacktestReport.to_full([with_dividend, ...])

Calculate performance metrics and generate visualizations for a given strategy.

SETBacktestReport.to_html([with_dividend, ...])

Generates an HTML tearsheet for strategy performance analysis.

SETBacktestReport.to_snapshot([...])

Generates a snapshot plot of portfolio performance.

SETBacktestReport.all_trades

SETBacktestReport.avg_bar_held

SETBacktestReport.avg_lose_bar_held

SETBacktestReport.avg_loss

SETBacktestReport.avg_profit

SETBacktestReport.avg_profit_loss

SETBacktestReport.avg_win_bar_held

SETBacktestReport.cagr

Calculates the communicative annualized growth return (CAGR%) of access returns.

SETBacktestReport.cagr_divided_maxdd

Calculates the calmar ratio (CAGR% / MaxDD%)

SETBacktestReport.cagr_divided_std

SETBacktestReport.cumulative_return_df

Cumulative Return DataFrame.

SETBacktestReport.dividend_df

Dividend DataFrame.

SETBacktestReport.drawdown_percent_df

Drawdown Percent DataFrame.

SETBacktestReport.end_date

End date.

SETBacktestReport.ending_capital

SETBacktestReport.initial_capital

SETBacktestReport.loss_trades

SETBacktestReport.max_lose_consecutive

SETBacktestReport.max_win_consecutive

SETBacktestReport.maximum_drawdown

SETBacktestReport.monthly_return_df

Monthly Return DataFrame.

SETBacktestReport.net_profit

SETBacktestReport.pct_avg_loss

SETBacktestReport.pct_avg_profit

SETBacktestReport.pct_avg_profit_loss

SETBacktestReport.pct_buy_slip

Percent buy slip.

SETBacktestReport.pct_commission

Percent commission.

SETBacktestReport.pct_exposure

SETBacktestReport.pct_maximum_drawdown

Calculates the maximum drawdown.

SETBacktestReport.pct_net_profit

SETBacktestReport.pct_sell_slip

Percent sell slip.

SETBacktestReport.pct_win_per_trade

SETBacktestReport.position_df

SETPosition DataFrame.

SETBacktestReport.price_distribution_df

Price Distribution DataFrame.

SETBacktestReport.start_date

Start date.

SETBacktestReport.stat_df

Stat DataFrame.

SETBacktestReport.std

Calculates the volatility of returns for a period.

SETBacktestReport.summary_df

Summary DataFrame.

SETBacktestReport.summary_trade_df

Summary Trade DataFrame.

SETBacktestReport.total_commission

SETBacktestReport.total_loss

SETBacktestReport.total_profit

SETBacktestReport.trade_df

Trade DataFrame.

SETBacktestReport.win_trades