Skip to content

DOC: Explain backtest statistics formulas - #1401

Open
Stamina9 wants to merge 1 commit into
kernc:masterfrom
Stamina9:codex/document-stat-formulas-pr2
Open

DOC: Explain backtest statistics formulas#1401
Stamina9 wants to merge 1 commit into
kernc:masterfrom
Stamina9:codex/document-stat-formulas-pr2

Conversation

@Stamina9

Copy link
Copy Markdown

Closes #1238.

Summary

  • Document the formulas and assumptions behind the less self-explanatory values returned by Backtest.run().
  • Explain why Buy & Hold Return [%] begins after indicator warm-up and can therefore change with an indicator lookback.
  • Record annualization conventions for intraday through yearly data and the distinction between annualized return and CAGR.
  • Clarify the definitions of Sharpe, Sortino, Calmar, alpha, beta, profit factor, expectancy, SQN, and Kelly Criterion.
  • State when annualized statistics return NaN.

Testing

  • python -m flake8 backtesting/backtesting.py
  • python -m unittest backtesting.test._test.TestDocs.test_backtest_run_docstring_contains_stats_keys
  • git diff --check

Scope

Documentation only; no runtime behavior changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can formulas for 'stats' be provided

1 participant