Skip to content

docs: clarify benchmark weighting semantics - #2328

Open
dajinzhu wants to merge 1 commit into
microsoft:mainfrom
dajinzhu:fix/2315-benchmark-weighting-docs
Open

docs: clarify benchmark weighting semantics#2328
dajinzhu wants to merge 1 commit into
microsoft:mainfrom
dajinzhu:fix/2315-benchmark-weighting-docs

Conversation

@dajinzhu

Copy link
Copy Markdown

Summary

Related to #2315.

  • Clarify that a list benchmark is calculated as an equal-weighted average of the supplied instruments.
  • Clarify that a string benchmark uses the return series of one benchmark instrument.
  • Document the weighting effect when an equal-weighted strategy is compared with a cap-weighted index.
  • Add a regression test covering the list-benchmark equal-weighting semantics.

This pull request intentionally does not change Qlib's default SH000300 benchmark or historical backtest behavior. A dynamic point-in-time equal-weight benchmark would require a separate design decision.

Testing

  • git diff --cached --check
  • python3 -m py_compile qlib/backtest/report.py tests/backtest/test_benchmark_weighting.py
  • PYTHONPATH=.../.openclaw/tmp/qlib .../.openclaw/tmp/qlib-venv/bin/python -m pytest -q tests/backtest/test_benchmark_weighting.py

Targeted test result: 1 passed.

@dajinzhu

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@dajinzhu
dajinzhu marked this pull request as ready for review August 19, 2026 12:48
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.

1 participant