datboi2001 / Defensive-Stock-Screener

This is a stock screener that allows people to sort through a list of stocks and filter out undervalued/defensive stocks
7 stars 3 forks source link

How long does it take if I have only one api key #1

Closed anthonykhy closed 3 years ago

anthonykhy commented 3 years ago

Please select where you want to save your result: ./ Please give your result a name (don't include the extension): out Do you want to import your own stock file(yes/no): no

i saw this screen pending for minutes... How long does it take to finish if I have only one api key

ghost commented 3 years ago

Hey Anthony thanks for checking out my project. I have not tried it out and but I can tell you that it's gonna take a long time. So I'm using seven API keys and with the list I got from Finnhub, it usually took me more than 700 seconds or 11 mins. You have to know that this is a free API key with a limit of 60 calls/minute. If it reaches the limit, the program pauses for 60 seconds and resumes the API call again. So this is just a guess. If seven API keys takes me 700 seconds, one API key will take me 4200 seconds.

On Sun, Oct 18, 2020, 8:20 PM Anthony Kwok notifications@github.com wrote:

Please select where you want to save your result: ./ Please give your result a name (don't include the extension): out Do you want to import your own stock file(yes/no): no

i saw this screen pending for minutes... How long does it take to finish if I have only one api key

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/datbeo2001/Defensive-Stock-Screener/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOGKX7R4H2YCXJ4MLOVPS2LSLOPABANCNFSM4SVQP32A .

ghost commented 3 years ago

Also, the reason why you have seen the screen pending for minutes is because out of almost 5k stocks you import from Finnhub, not a lot of them can match all of my criteria. The program sleeping for 60 sec and it just going through multiple stocks that don't match my criteria is the reason why you have been staring at a blank screen for minutes.

ghost commented 3 years ago

If you want to see some stocks popping up on your screen, go to match_conditions in main_screener.py and fixed the last line. Right now, the last line is basically telling you that if this stock matches all of the criteria, then we can move on to the next step. However, all of these criteria might be too much so you can decrease the number of criteria that the stock needs to pass. "count == len(criteria) -2" or "count == len(criteria) -3" are good enough. The stocks that you get back won't be 100% undervalued but I can tell you that those stocks are worth looking into. After all, this is just a tool that helps people get started in investing in undervalued stocks. It's not replication of a professional fund manager.