-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Feature/polygon-stock-quote: Add NBBO Quotes, with historical, to obb.stocks.quote()
#5617
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ance/OpenBBTerminal into feature/openbb-sdk-v4
…ance/OpenBBTerminal into feature/openbb-sdk-v4
…ance/OpenBBTerminal into feature/polygon-stock-quote
reviewpad
bot
added
feat L
Large T-Shirt size Feature
and removed
feat M
Medium T-Shirt size feature
labels
Oct 27, 2023
jmaslek
previously requested changes
Oct 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see this as a different endpoint than just quote. My biggest reasoning is just the pure amount of data you can get. Trying to just get a clean look, and oops i am now dealing with 6 GB
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds Polygon as a provider to the
obb.stocks.nbbo()
function. This has a default limit of 25 results, but can return an unstable amount of data if desired. I have put an internal cap at 10M entries. The limit argument becomes important when requesting historical data, especially for the most trafficked tickers.A typical day of SPY NBBO quotes will be around 5 million rows and nearly 1GB as a raw, uncompressed, CSV file. It is not recommended to go about it this way, but it is possible. Best practice would be to break up the request into smaller chunks - like an hour at a time - using the greater/less than parameters to bracket the period.
Just the default setting with only a ticker entered returns the most recent 25 NBBO Quotes:
Note examples here have a not-current name. The function and model have changed to
nbbo
, fromquote
.I looked into converting the condition and indicator codes but the reference tables in the Polygon documentation appear to be missing some entries and/or are not accurate.
For any query that includes a time, it must be formatted like this:
Example of a bracketed request:
Yields 317,491 records between 3:00 and 3:30 yesterday:
Lower volume stocks are way less heavy, the entire day for CLOV yesterday produces only 11,046 rows.