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

Portfolio.Values Not Actually Correct at All Times #102

Open
4 tasks
superichmann opened this issue Apr 1, 2024 · 1 comment
Open
4 tasks

Portfolio.Values Not Actually Correct at All Times #102

superichmann opened this issue Apr 1, 2024 · 1 comment

Comments

@superichmann
Copy link

Portfolio.Values not shows holding quantities from the broker even though there are holdings.
In the example I give it is called from Initialize function but this can happen throughout the strategy.

I know its a hard bug to fix. Please instruct me on how to actually yes check for the current actual holdings through a quantconnect c# strat. maybe I am doing something wrong.

If Portfolio.Values are not reliable at any point during the strat runtime please also say it so I could implement a different mechanism for positions tracking.

Expected Behavior

In live mode with broker Portfolio.Values should return the actual portfolio values or indicate in some manner that we dont have the current holdings at the moment.

Actual Behavior

Portfolio.Values returns 0 from holding.Quantity even if holding.Quantity is not 0.

Potential Solution

Populate Portfolio.Values before any user code is running.

Reproducing the Problem

in live mode, AddEquity to the maximum amount of tickers (100) minute data and have one position at ONE of the tickers.
in Initialize() go through Portfolio.Values in order to find the one position with holding.Quantity not 0.
no such position is found although actually yes exists in the broker.

System Information

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
@jaredbroad
Copy link
Member

Please submit live logs of the situation it happens

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

No branches or pull requests

2 participants