3. Structure of Backtest Results

3.1. Return Value Description

The object returned by qt.run(op, mode=1) is usually a backtest result container (e.g., a Backtester or a structure containing results), consistent with the qteasy 2.0 API. The exact type depends on the documentation.

3.2. Complete list of backtest result fields (list and briefly explain)

Below are common attributes/keys in backtest results and their meanings; refer to the current version for specifics.

Field/Attribute Name

Type

Meaning

loop_result

Structure/List

Loop run results by time step.

complete_values

DataFrame/array

A complete NAV or equity-curve series, including positions, cash, value, fee, and the p-{股票代码} daily price column(s), etc.

oper_count

int/dict

Number of operations or statistics by type.

summary

dict/str

Summary information (e.g., total return, Sharpe ratio, etc.).

Equity curve / net asset value

array/Series

Daily or per-period NAV.

Positions

DataFrame

Position details at each time point (if any).

Other possible fields: trade details, fee summaries, etc. Please refer to the actual properties of the returned object.

3.3. Equity curve and positions

  • Extract daily NAV from the result: it usually comes from the value column of complete_values or a similar attribute.

  • Same-day price: In complete_values, the p-{股票代码} column contains each instrument’s closing price for that day; if missing, it is NaN.

  • Position ratio: If the results provide a positions table, you can aggregate by instrument and date to calculate the ratio.

3.4. Performance metrics

  • The results may already include evaluate or built-in performance metrics (Sharpe ratio, maximum drawdown, annualized return, win rate, etc.).

  • How to obtain it: e.g., result.summary, result.evaluate(), or calling an evaluation function separately—refer to the API documentation.