Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update utils.py #1435

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Update utils.py #1435

wants to merge 4 commits into from

Conversation

Vanchrn
Copy link

@Vanchrn Vanchrn commented Feb 10, 2023

Description

In /contrib/strategy/signal_strategy.py,
it comments
"get the number of trading step finished, trade_step can be [0, 1, 2, ..., trade_len - 1]"
If set finished == self.trade_step >= self.trade_len it will raise IndexError: index X is out of bounds for axis 0 with size X.
I think change self.trade_len = _end_index - _start_index + 1 to self.trade_len = _end_index - _start_index maybe better, but it may result in other errors.

Motivation and Context

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

@github-actions github-actions bot added the waiting for triage Cannot auto-triage, wait for triage. label Feb 10, 2023
Cadenza-Li and others added 3 commits March 21, 2023 14:29
trigger PR CI re-run
revert blank.
fix W291 trailing whitespace
In /contrib/strategy/signal_strategy.py,
it comments
"get the number of trading step finished, trade_step can be [0, 1, 2, ..., trade_len - 1]"
If set finished == self.trade_step >= self.trade_len it will raise IndexError: index X is out of bounds for axis 0 with size X.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you tell me which script will raise the IndexError error you mentioned here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for triage Cannot auto-triage, wait for triage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants