-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Polygon stock load #1757
Polygon stock load #1757
Conversation
@@ -111,7 +112,9 @@ def print_help(self): | |||
{self.add_info}[cmds] | |||
quote view the current price for a specific stock ticker | |||
candle view a candle chart for a specific stock ticker | |||
news latest news of the company[/cmds] [src][News API][/src] | |||
news latest news of the company [src][News API][/src] | |||
codes FIGI, SIK and SIC codes codes[/cmds] [src][Polygon.io][/src] |
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.
Is this worth being a command?
Also, we should only display this command if there is a valid polygon key
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.
yes.
we show the news line even if there is not a valid news api key
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.
Does the Polygon data here can be accessed with their free tier? if yes, nvm my comment. If not, let's hide it for users that don't have a valid paid API key
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.
Yup :D afaik everything they have can be accessed through the free tier.
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.
So nevermind what I said!
import yfinance as yf | ||
from alpha_vantage.timeseries import TimeSeries | ||
from numpy.core.fromnumeric import transpose | ||
from plotly.subplots import make_subplots | ||
from scipy import stats | ||
|
||
from openbb_terminal.config_terminal import theme | ||
from openbb_terminal.config_terminal import theme, API_POLYGON_KEY |
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.
let's load config_terminal as cfg and then use cfg.API_POLYGON_KEY
. That's how we doing in the other places
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.
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 honestly don't like implicit imports. I think having cfg.theme
is much more visible where that comes from, and would rather us doing that
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.
just tryna use your code against you ;)
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.
that also imports everything and is why we initially had such slow load times
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.
config_terminal
is always loaded even if you do from config_terminal import theme
it just creates that theme
reference on the file.
The slow load times were "solved" by putting the import within a command, not based on how we load a module.
I am still a pain 😄
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.
that you are <3
now approve
OH BABY! That’s the missing link in the stock search! Search —> codes —> symbols —> long name —> description
… On May 3, 2022, at 6:28 AM, didierlopes.eth ***@***.***> wrote:
@DidierRLopes requested changes on this pull request.
In openbb_terminal/parent_classes.py <#1757 (comment)>:
> @@ -438,7 +438,9 @@ def call_load(self, other_args: List[str]):
"--source",
action="store",
dest="source",
- choices=["yf", "av", "iex"] if "-i" not in other_args else ["yf"],
+ choices=["yf", "av", "iex", "polygon"]
+ if "-i" not in other_args
or --interval
In openbb_terminal/stocks/stocks_controller.py <#1757 (comment)>:
> @@ -111,7 +112,9 @@ def print_help(self):
{self.add_info}[cmds]
quote view the current price for a specific stock ticker
candle view a candle chart for a specific stock ticker
- news latest news of the company[/cmds] [src][News API][/src]
+ news latest news of the company [src][News API][/src]
+ codes FIGI, SIK and SIC codes codes[/cmds] [src][Polygon.io][/src]
Is this worth being a command?
Also, we should only display this command if there is a valid polygon key
In openbb_terminal/stocks/stocks_helper.py <#1757 (comment)>:
> import yfinance as yf
from alpha_vantage.timeseries import TimeSeries
from numpy.core.fromnumeric import transpose
from plotly.subplots import make_subplots
from scipy import stats
-from openbb_terminal.config_terminal import theme
+from openbb_terminal.config_terminal import theme, API_POLYGON_KEY
let's load config_terminal as cfg and then use cfg.API_POLYGON_KEY. That's how we doing in the other places
—
Reply to this email directly, view it on GitHub <#1757 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AUOMPBVNAUQGCFQUZE3SAQLVIESY5ANCNFSM5U5TIQTQ>.
You are receiving this because you were mentioned.
|
Adding in load
--source polygon
from polygon.ioThe free tier allows 5 calls/minute and it seems that the minute calls give a lotto data, up to 50,000 entries... We already have polygon API key in the terminal.
More to come :D
I did tests
edit: I did more
@deeleeramone here are figi and SIK codes from polygon's endpoint