alvarobartt / investpy

Financial Data Extraction from Investing.com with Python
https://investpy.readthedocs.io/
MIT License
1.59k stars 375 forks source link

improve get_stocks_overview function #160

Open alvarobartt opened 4 years ago

alvarobartt commented 4 years ago

There is an Investing.com feature, Stock Screener, which can be implemented to investpy, so as to use its API instead of retrieving the data from the stock tables presented in investing.com.

Reference: https://www.investing.com/stock-screener/

MatthieuH5565 commented 3 years ago

There is an Investing.com feature, Stock Screener, which can be implemented to investpy, so as to use its API instead of retrieving the data from the stock tables presented in investing.com.

Reference: https://www.investing.com/stock-screener/

Hey, any update on when this will be available in investpy?

CjS77 commented 3 years ago

Hey, I've written a module in my fork of investpy for this. If you're interested I can push a PR.

It works like this:

midCapUS = investpy.ScreenerParams() \
.with_country("United States") \
.add_filter("Market Cap", 200e6, 1e9) \
.add_filter("Price to Sales (TTM)", 0, 10) \
.add_filter("P/E Ratio (TTM)", 0, 40) \
.add_filter("EPS(TTM) vs TTM 1 Yr. Ago", 0, 1e9)
results = investpy.screener(midCapUS, as_dataframe=True, n_results=100)

Screenshot from 2020-10-20 09-03-24

alvarobartt commented 3 years ago

Hi @CjS77! Thank you for the proposal!

Currently we are taking some days to understand how to reformat the project as a lot of changes are coming as some collaborators will be joining me on the investpy development as stated in: https://twitter.com/alvarobartt/status/1317426156245843968 (BTW if you wish to, leave a follow so as to get notified of all the updates)

Maybe we can discuss including this as a PR next week? Thanks a lot! 👍🏻

CjS77 commented 3 years ago

No problem. To be clear, the code is done, and you can view the diff here.

You guys are welcome to do whatever you want with it.. it works well for me right now, but I won't have time to spend any more time on it, so if you don't use it, that's ok too :)

MatthieuH5565 commented 3 years ago

No problem. To be clear, the code is done, and you can view the diff here.

You guys are welcome to do whatever you want with it.. it works well for me right now, but I won't have time to spend any more time on it, so if you don't use it, that's ok too :)

Hey, I've written a module in my fork of investpy for this. If you're interested I can push a PR.

It works like this:

midCapUS = investpy.ScreenerParams() \
.with_country("United States") \
.add_filter("Market Cap", 200e6, 1e9) \
.add_filter("Price to Sales (TTM)", 0, 10) \
.add_filter("P/E Ratio (TTM)", 0, 40) \
.add_filter("EPS(TTM) vs TTM 1 Yr. Ago", 0, 1e9)
results = investpy.screener(midCapUS, as_dataframe=True, n_results=100)

Screenshot from 2020-10-20 09-03-24

Hello

is there any way to add the "ScreenerParams()" to the investpy module?

alvarobartt commented 3 years ago

Sure @MatthieuH5565 ! I'm currently mad busy (work plus MSc thesis) but I'll get back to this during mid January! 🤗

MatthieuH5565 commented 3 years ago

On Tue, 22 Dec 2020 at 10:51, Álvaro Bartolomé notifications@github.com wrote:

Sure! I'm currently mad busy (work plus MSc thesis) but I'll get back to this during mid January! 🤗

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/160#issuecomment-749425918, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQP77T63GV5AORWMP6GORV3SWBMYPANCNFSM4NC44RDQ .

Awesome no stress.

Good luck with your studies all the best.

alvarobartt commented 3 years ago

Thanks a lot @MatthieuH5565! Happy holidays BTW 👍🏻