-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Don't blow up if fields are missing #523
Conversation
Sometimes we don't have data (i.e., no bids/asks, no market price) for contracts, and rather than blowing up we should just continue gracefully
I'm not 100% sure this is the desired behaviour, I need to understand some of the changes from #521 a little better. I think in some cases it might be better to go through the path above this exception (i.e., in case it's better to close the contract). |
so in this code block, there are several potential calls that could cause this problem:
My assumption was
so if this data is not available, then it means the symbol does not have an open interest or there is no last price. so that's why I make it a required field for most of the underlying related API calls. |
Here's the stack trace for the case where this was triggered:
In this particular case, the contract has no bids, and it would be preferable to simply close it out because it's profitable, so I think it should be triggering the This might be a special case where we should just treat contracts with no market price as $0.01 or something. With the old behaviour, it wouldn't throw an exception if there's no market price, it would just make a best effort. |
See #524, I think that is the preferred behaviour in this case. |
okay, so if that's the case, then we should:
|
Sometimes we don't have data (i.e., no bids/asks, no market price) for contracts, and rather than blowing up we should just continue gracefully
FYI @junyuanz1