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

Stock Split When Short Causes Negative Equity With Raw Data #7894

Closed
4 tasks done
DerekMelchin opened this issue Apr 3, 2024 · 0 comments · Fixed by #7985
Closed
4 tasks done

Stock Split When Short Causes Negative Equity With Raw Data #7894

DerekMelchin opened this issue Apr 3, 2024 · 0 comments · Fixed by #7985
Assignees
Labels
bug good first issue If you're looking to get started as a LEAN contributor, check out these starter issues! impact-high

Comments

@DerekMelchin
Copy link
Collaborator

DerekMelchin commented Apr 3, 2024

Expected Behavior

If we are short a stock when a stock split occurs, our equity value doesn't drop below zero.

Actual Behavior

AlgorithmManager.Run(): Portfolio value is less than or equal to zero, stopping algorithm.

Potential Solution

N/A

Reproducing the Problem

https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_5aaa2df0fe22fb61050280d5a61c07e6.html

The research notebook of this project shows that there is no price data issue.

TSLA and AAPL both have a stock split during the backtest period in this algorithm. If you swap the asset in the algorithm to AAPL, you'll get the same error.

The error only occurs with Raw data normalization. If you use adjusted prices, the error doesn't occur.

System Information

QC Cloud

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
@DerekMelchin DerekMelchin changed the title Stock Split When Short Causes Negative Equity Stock Split When Short Causes Negative Equity With Raw Data Apr 3, 2024
@jaredbroad jaredbroad added bug impact-high good first issue If you're looking to get started as a LEAN contributor, check out these starter issues! labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue If you're looking to get started as a LEAN contributor, check out these starter issues! impact-high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants