microsoft / microsoft/qlib

a bug in TopkDropoutStrategy

Open
#612 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
48.7k
Forks
7.7k
PR merge metrics
No merged PRs in 30d

Description

Risk_degree should be applied to the whole account, not just cash. It's OK at the inception of the portfolio when cash is equal to the whole account value, but after that, it's not OK anymore.

https://github.com/microsoft/qlib/blob/114c38b4c3a01f7b9c3c1258d55ea7c1557a3c54/qlib/contrib/strategy/strategy.py#L389

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in qlib/contrib/strategy/strategy.py at the TopkDropoutStrategy logic referenced near line 389, and trace how risk_degree is calculated from cash and account value. Confirm the intended account-wide behavior described in the issue, then verify that risk_degree is no longer limited to cash and add or run relevant regression coverage if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
fintech-quant
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.