Three vids down, six to go. I've been troubleshooting along the way finding my errors. You have done such an incredible service by posting these tutorials. Thanks again.
Just started reading Mark Minervini's "Trade like a stock market wizard" and this program is really going to come in handy. I'll have to go over the code and video a few times to make sure I understand everything but huge thanks for your time and effort in creating this!
15:13 Repetitive, but the way you organize it making so easy to follow is amazing! Glad you didn't choose to skip, because we as the viewer can just do that :)
Thanks for the video. This python script saves so much time. I also appreciate the introduction to using yfinance and python. What great tools! Your explanations and timing are just right. You help out people new to programming and don't bore guys that know how to code. Great work!
Appreciate your great work, absolut amazing Richard. When you delete the line stocklist=stocklist.head(), the program runs in an infinite loop. you must insert the number of lines (stocks). eg for 50 stocks stocklist=stocklist.head(50). You are the reason why i will purchase an Raspberry Pi for such funny stuff. You should get a commision from them. THX Markus
Hi Richard ... i have not done coding for 25 years :) Last time i did it, it was Turbo Pascal. So ... not knowing anything about the Python, following your steps i have built my own screener that just ran across 600 stocks and returned 20 for further analysis. Thank you Sir! Also ... you planted additional riddle for me ... i could not figure out why my script was pulling only first 5 items from my large list. I was looking for some counter i=5 :) You hid it well .... but i found it :) Thank you again!
Thank you for the nice tutorial. I ran the script and here are my findings. Step 1: Run with .head of old data based on your google sheets - done. Step 2: Get update from Marketsmith - done. Step 3: Run script removing .head based on whole list extracted from step 2 - failed. Solved. I needed to convert file to xls format to satisfy pandas module which does nto read later versions of excel anymore. Step 4: Run script removing .head based on whole list extracted from step 2 - failed after 297/4500 iterations. (I think the query portion of the script concerning yfinance and its api times out?). Step 5: Rerun script implementing sleeping script after each iteration. - failed again. - Script just hangs. Step 6: Reran script after tweaking connection and exception settings to increase robustness: Results: I got approximately 1300/4500 companies satisfying the 1-7 criteria concerning moving averages and then the RS criteria (condition 8). Does this sound about right? If not, I will go back and have a look where I went wrong.
I went over this today again and it is working great. It will be nice as a Streamlit app, with the indicators plotted on it, for a better visual appeal, and a selection list of the top candidates from the resulting list at least. Very nice.
Great Video after paying for many course and good fees i am not able to find such a useful information that you are providing in free , very very thankful to you and hope you will keep it going and will try to spread it as much i can that other benefit it also, thank you again Friend
WOW!! This was great! I am going to have to re-watch this again, for there was many things I missed, while I was taking notes. Very informative and full of good information. Thanks for doing this great presentation.
Hi Richard, your videos are great. Quick question, does yahoo finance or is there a way to create a scanner or an endpoint to scan through all stocks without providing a list of stocks to scan through? I noticed in your videos you are passing a list of stocks or have specific stocks column to iterate over. Thanks in advance.
This is brilliant Richard, I use Finviz as a screener but you can't filter to Mark's requirements exactly on the free version, intend to toy around adding a few custom conditions, definitely above $10, and maybe market cap and average volume.
Thank you very much! This video. and all your others has REALLY been profitable! I built a stock screener that runs every day and posts the result in my discord channel. so i know which stocks to take a look at. I don't have _crazy_ numbers yet, but currently beating the market by a fair amount. And that feels great!
@@RichardMoglen m able to print dataframe and it prints values but excel was empty initialy, though a little debugging helped. I printed the exceptions and got the solution.
Types of Programs I'd like to create - A really good custom Stock Options Scanner that can either Scrape data from a public site or pull it through a free APi is my main goal. Awesome video by the way - Thank you for this, liked hit the bell and subscribed !
It is a minor thing, and most likely won't affect performance (but maybe readability in my opinion). you could set the condition variables equal to the logic passed as the argument for your if statement. cond1=currentClose>etc...
Hi Richard, great video. One question, maybe you gave the answer but English is not my language I could not understand. It can only be done with 5 stocks? Is there any way to scan the rest of the list? Thanks
I checked screener and many more stock filters online but either they were not good enough, i always wanted more features or they were charging a hefty amount. In past i had worked in python and R Programming. So I could understand this all very well. Thank you.. you are genius
Fantastic video. I might have ran into a issue. The code seems to run as it should without any problems according to the text editor but it does not manage to find any stocks that meet the requirements that was set up. So the program does not create an excel file. Have i done something wrong or is it just that it does not make a file if there are no sqreening results?
Interesting stuff, I am playing with this code now myself after reading Minervini's book. Some thoughts: You set moving_average_200_20past = 0 if the try/except fails. So, if it fails, your condition "if moving_average_200 > moving_average_200_20past" will always be true. Any time that line fails, your stock will pass the test. Because you will have set "moving_average_200_20past" to zero. What if the actual "moving_average_200_20past" was 5 million? And you just couldn't access the data. Also, the "within 25% of the 52 week high" condition is not 100% correct. It should be within 25%, but not past it. So you need another condition to say that it should not be greater than the 52 week high. It cannot be gone past the 52 week high, because then the current price will be the 52 week high ( a paradox).
Thanks for the great vids as always richard!! I think for the condition flags you could just do cond_2=(moving_average_150 > moving_average_200) etc to set the flags without the if/else statements, right?
Great videos man. I'll try to make a program that captures the maximum drawdown and rally and compares them to their median. That way you can set a trailing stop loss/sell limits that don't trigger with volatility but do trigger on good timing
Thanks so much for these videos Bro!.... I am new to trading and relatively new to python and your videos are awesome and great teaching.... looking forward to more.
hi richard! thank u so much for the tutorial! I am looking to create a web app where users can screen for stocks. Python has been amazing, now im looking into how to match the back end and the front end.
Thanks for this video series, this is super helpful for me getting into investing. I do have a couple of questions that i can't seem to fix. I've used the excel sheet you linked to in the description, but the top 5 just prints out "no data on (ticker)". Shouldn't i get the same 2 results as you in the video? Or is it because the data in the sheet you uploaded is more up to date with the current situation and that has caused the stocks to no longer meet our conditions?
I'm so glad you are enjoying the series! What stocks are in the top 5? You shouldn't get the same results, in fact because of the poor conditions very few stocks should meet the criteria. However most stocks on that list should still have data.
@@RichardMoglen The top 5 is INMH, ENPH, PLMR, VCTR. SEDG. I suspected that might be the case, but this is all new to me so i wasn't sure. Thanks for taking the time to respond!
Hi Richard, thanks for the videos ! Subscribed and liked, really digging your approach.... Could you help me with a traceback error I'm getting for the line "stocklist = pd.read_excel(filePath)" ... ? It denies the permission for my file path. Why is that?
So good man!. It worked. Thanks so much for doing this Richard appreciate it. Have lots to learn on this, I've actually had a few errors when importing the modules, but glad that pip3 install worked fine. :-)
Great Series Richard- loving and learning with every video :) Just a quick question- how would we add a sleep.time delay to our code so not to overload the finance API ?
Hi Richard, Thank so much for your great share that I’m wishing and dreaming about. I love backtest, stock screen, use model to predict stock price and may be if grab financial index ( ex: ROA, Debt, devidend, eg) Python programming
Thank you for a great video, Richard. I really enjoy this finance series. There is one thing I cannot get working, though. I would like to create my own input csv file. If I export a portfolio from Yahoo finance, I will have the symbol for the stocks, but what about the RS rating? How do I add that column? Is your input csv file generated from yahoo finance or elsewhere?
RS rating is only from IBD/Marketsmith. For importing CSV files check out this: pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html
By the way, it would be great if you could covet Point and Figure charts in a similar video. There are plenty of resources to understand how to create them, but I have never come across a good explanation of how to make use of them for possible future stock movement, and moreover how to use them in Python.
@@RichardMoglen really great videos! Keep them up, subscribed! I was wondering if there are some other alternatives to get similar data as on the MarketSmith one? I wouldn't invest yet $20 for the three weeks before playing with their data.
@@PeterJavorkai_is_on_fire So IBD offers several different products. The regular online subscription includes a stock screener which provides a lot of the same data but with less flexibility.
Richard, thank you very much for this amazing content. Totally support you, and keep it coming! A Question please: I find this line pretty confusing: df['sma_'+str(sma)] = round(df.iloc[:4].rolling(window = sma).mean(), 2) why don't just replace it with something like this?: 'df['sma_'+str(sma)] = df.rolling(window = sma).mean()['Adj Close'] Thanks!
I'm not familiar with this syntax but let me know if it works. My line may be confusing because I am also rounding the moving average to 2 decimal places
@@RichardMoglen yes I think the dif is that you're using iloc to index column, I used column name. Also in the video you had iloc[:4] which indexes up to the third row! That's what confused me at first. Of course it is corrected in the scripts you've been so kind to upload to iloc[:,4] to get the third column. Btw i've also found a way to write the if statements in way that takes less code. Will muck around with it, then post it if it works. Thanks man! Looking forward to your upcoming python tutorials !
Hello Richard, I am learning significantly from you...... Thank you for this. In this tutorial the code works off of your excel sheet to obtain the IBD RS value. I wish to obtain your thoughts on how to establish this value on stocks that are not in your list. I have wrecked my brains with excel to no avail on how to calculate the IBD RS. Initially I would like to calc it against S&P500, but in the future I would like to calc it on economic sectors (Since I have the data) hopefully to bypass indexes that are tampered with. Your insights would be very useful to me. Thank you in advance.
Love your videos, however having slight trouble. When I try to run "stockscreener.py" it doesn't execute and says at the very end of its process "Excel xlsx file; not supported". Is there a solution to this?
Change the file type on the downloaded spreadsheet to "xls ". Once you do that make sure you update the filetype in the "filePath" as well. Pandas is not supporting "xlsx" because of some issues with Python 3.9. Best of luck!
Great video but I ran into insoluble problem with stocklist = pd.read_excel(filePath) stocklist=stocklist.head() Probably something to do with the filepath I entered? Were we to link to the file in Google Docs. ..... Amateur beginner at work here.
Hey Richard, great videos by the way. I was wondering if you could upload the raw excel sheet with that data every time you make a video from this playlist because it is very helpful but I'm worried it'll be outdated if I keep using it. Thanks!
Thanks Joe. If you want updated info (such as the RS rating) I suggest getting an IBD online subscription and downloading it from the IBD stock screener.
Thank you for taking the time to write and share this knowledge. You are truly teaching us all 'how to fish.' Question - I am getting that pandas.util.testing is deprecated message (and it looks like you are too). What does this mean, and how would you suggest we adjust for this when we can't use it anymore?
Thanks for watching! I haven't yet found a way to disable the message. To my knowledge this doesn't affect performance in any way. We don't use that functionality.
Im amazed, really yout should be honored. You got subscribed for sure. There is just one question behind and ,maybe i didnt get i right because im not native. The data we are using here "Richard All Stocks" its a one time fixed data sheet right? So the datas are not renew by itself right? The programm runs perfectly...but the data sheet behind how get it updated? Which ressource you used for it?So the Excel File Richard All Stocks is based on what? Thanks a lot rreally apperciate it
Hows it going Richard, I was curious where you get these excel spreadsheets with this data? Do you use a python scraper to compile these? If so it would be awesome if you could do a video on scraping stocks for these programs. Thanks again for your work, Liked and Subscribed.
Welcome to the channel! I download these fundamental sheets from MarketSmith: marketsmith.investors.com/ms-platform/?src=A00587A&refcode=RM_Links Best source for fundamental data!
Hi Noel, no not at all. You could instead define an array of stocks in the python program: list= ["AAPL","MSFT","FB"] for i in list: ... let me know if you have any questions!
Hi Richard, Is it possible to code a scanner that can be run over all tickers at live market data? I'm trying to understand the tracking process, Is the process required to import all data from API supplier, then my machine will do the filtring OR my filtering codes would be recognized by API supplier and filter it for me before showing up on my screen? Thank you
With python you could handle a subset of stocks ~100 but It would take too long to cover much more than that. The way I know how to do it you have to download the data and process it yourself.
@@RichardMoglen The idea is to make my filtering scan works for only the top 50 of the highest volume, and that changes from time to time! There're tens of live market data suppliers, Any of those would recommend getting the live market data from?
I'm learning Python and would like to know if there is a way to program code that scans the us exchanges live for specific signals to alert me when the 20 day moving average crosses the VWAP? Is this possible?
does the Python scanner instant or does it take a couple of minutes? The reason I ask is I use the 1 min chart and I need instant results and TOS which is the scanner I use now is dynamic and sends alerts every 3 min. which is too slow for me so I am looking for alternatives. Thanks
It is not instant, it has to do all the calculations for each stock. I would check out TC2000's scanner which is the one I use for real time: t.co/TstyZKXiGW?amp=1
Hi Richard, great video tutorials on Python! When I run the code in cmd It returns that there is "no data" per each stock and also that there is "empty DataFrame". Any ideas on how to fix this? Thanks!
Hi Richard, I am a bit confused about the way you utilized the if/else code. If all those conditions have to be met, wouldn't you need to use IF/ELIF to check that multiple statements are true?
Great video and thank you for explaining the code. If I wanted to only get stocks above a market cap of $2 billion and an RSI (14) of 30, how could I do it? I would appreciate the help. Thank you
This is great stuff, man! I've really enjoyed it so far. Question for you: Since this video is from about three months ago, is the data that we use from the Excel sheet not useful for the current market? In other words, should I try to get newer data before making my investing decisions?
Why did we ignore the index when appending the exportList at the end after the if conditions? Without it (igonre_index=False) it returns an empty list. But I can’t figure out why.
hi Richard - amazing video as always--- could you please share the performance stats over 3-4 months of using this technique pls? ofcourse covid runied lot of plans but would be good to know..
Richard Moglen sorry Richard- perf stats is probably a wrong word -what I meant is if you have been using this technique to buy in the market ,How have you been doing so far?
Hey Richard seems like i'm getting a bug related to "The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead." Is there any work around with this?
Amazing Series Richard!! I am new to coding but this series has helped me learn a lot but I get stuck only on one thing that is getting a fundamental sheet for indian market. I have check all the videos and all the sites but unable to get RS rating for indian market. Could you please help me
Hi Richard, Thanks for the great videos! They are very informative and you are great at explaining things step-by-step. Keep up the great work and your channel will become successful. I am curious as to where you are getting the source excel spreadsheet? Is that another custom screener or something that is available to the public? I am not sure how much you use options, but a volatility calculator might be a useful idea for a future series. Thanks again.
Hi Andy, you might want to check out Richard's twitter (@RichardMoglen) where he tweeted about this excel spreadsheet. If I remember correctly the data is from Investor's Business Daily. Hope it helps, I am not sure it is available for free though
Thanks for the nice words Andy. I get the data for my spreadsheet from Marketsmith as Valentin said. A Volatility calculator is a great idea thank you!
Hi Richard, thank you for all the videos from Italy! I really appreciate this video. I have a question for you: can I automatically fill the excel input file from yahoo finance or whatever other financial website? Otherwise I should fill the file by myself and it will cost me a lot of time. Thank you for your answer
hi Richard i am a big fan of you, do you have guide how to export the ticker info into excel? i search this out and found that yahoo had disabled the export function? is it true?
Hey Richard, I am getting an error in my code when trying to read a spreadsheet from chart mill, the error is Traceback (most recent call last): File "C:\Users\avery\Documents\StockScreener.py", line 28, in RS_Rating=stocklist["RS_Rating"][i] File "C:\Users\avery\Documents\lib\site-packages\pandas\core\frame.py", line 3024, in __getitem__ indexer = self.columns.get_loc(key) File "C:\Users\avery\Documents\lib\site-packages\pandas\core\indexes\base.py", line 3082, in get_loc raise KeyError(key) from err KeyError: 'RS_Rating' Also when I scan your excel sheet it only gives me 4 stocks, is this normal? Thank you
Hey Richard, They should be nearly identical, although the MarketSmith screen can sample the RS rating straight from their database and has a different time settings
Thanks@@RichardMoglen . If I want to run this on a list of stocks from, say, Hong Kong or China exchanges but don't have an RS rating, do I need to remove any lines of code? I realise this wouldn't strictly meet Minervini's criteria, but it would be a start! Thanks.
Three vids down, six to go. I've been troubleshooting along the way finding my errors. You have done such an incredible service by posting these tutorials. Thanks again.
Glad you find them helpful Wes!
first time ever saw a RUclipsr explained each an everything really loved ur way of teaching ❤
Thank you so much 😀
@@RichardMoglen why dont you make more videos on programming for algo in python now a days as will love to watch more about it an learn more
Just started reading Mark Minervini's "Trade like a stock market wizard" and this program is really going to come in handy. I'll have to go over the code and video a few times to make sure I understand everything but huge thanks for your time and effort in creating this!
My pleasure! Thanks for watching!
15:13 Repetitive, but the way you organize it making so easy to follow is amazing! Glad you didn't choose to skip, because we as the viewer can just do that :)
Of course, its always best to show more and let the viewer go as past through the process as they want. Have a great weekend!
Thanks for the video. This python script saves so much time. I also appreciate the introduction to using yfinance and python. What great tools! Your explanations and timing are just right. You help out people new to programming and don't bore guys that know how to code. Great work!
Thanks so much John!
For the Tutorial's sake, I was only running the top 5 stocks. To run a complete scan delete the line stocklist=stocklist.head()
Appreciate your great work, absolut amazing Richard. When you delete the line stocklist=stocklist.head(), the program runs in an infinite loop. you must insert the number of lines (stocks). eg for 50 stocks stocklist=stocklist.head(50). You are the reason why i will purchase an Raspberry Pi for such funny stuff. You should get a commision from them. THX Markus
Hi Richard ... i have not done coding for 25 years :) Last time i did it, it was Turbo Pascal. So ... not knowing anything about the Python, following your steps i have built my own screener that just ran across 600 stocks and returned 20 for further analysis. Thank you Sir!
Also ... you planted additional riddle for me ... i could not figure out why my script was pulling only first 5 items from my large list. I was looking for some counter i=5 :) You hid it well .... but i found it :) Thank you again!
Ha, glad you found the video useful!
Would you be able to show how you made the all stocks excel template?
Thank you for the nice tutorial. I ran the script and here are my findings.
Step 1: Run with .head of old data based on your google sheets - done.
Step 2: Get update from Marketsmith - done.
Step 3: Run script removing .head based on whole list extracted from step 2 - failed. Solved. I needed to convert file to xls format to satisfy pandas module which does nto read later versions of excel anymore.
Step 4: Run script removing .head based on whole list extracted from step 2 - failed after 297/4500 iterations. (I think the query portion of the script concerning yfinance and its api times out?).
Step 5: Rerun script implementing sleeping script after each iteration. - failed again. - Script just hangs.
Step 6: Reran script after tweaking connection and exception settings to increase robustness:
Results:
I got approximately 1300/4500 companies satisfying the 1-7 criteria concerning moving averages and then the RS criteria (condition 8). Does this sound about right? If not, I will go back and have a look where I went wrong.
I went over this today again and it is working great. It will be nice as a Streamlit app, with the indicators plotted on it, for a better visual appeal, and a selection list of the top candidates from the resulting list at least. Very nice.
Great Video after paying for many course and good fees i am not able to find such a useful information that you are providing in free , very very thankful to you and hope you will keep it going and will try to spread it as much i can that other benefit it also, thank you again Friend
Thanks man!
WOW!! This was great! I am going to have to re-watch this again, for there was many things I missed, while I was taking notes. Very informative and full of good information. Thanks for doing this great presentation.
I subscribed because you said cmin in the last video with a straight face.
lol!
Never stop making videos, we need you in our mission to beat the suits
Will do haha
Hi Richard, your videos are great. Quick question, does yahoo finance or is there a way to create a scanner or an endpoint to scan through all stocks without providing a list of stocks to scan through? I noticed in your videos you are passing a list of stocks or have specific stocks column to iterate over. Thanks in advance.
This is brilliant Richard, I use Finviz as a screener but you can't filter to Mark's requirements exactly on the free version, intend to toy around adding a few custom conditions, definitely above $10, and maybe market cap and average volume.
Great Brett, All you need to do is add some if statements!
Richard, Your videos are very informative, knowledgeable, and well made. Thanks for sharing all the information.
Great video! I enjoy how easy it is to follow along. Thanks for putting so much time into this.
love what you're doing Richard!! thanks again, looking forward to the next video.
More to come!
Thank you very much! This video. and all your others has REALLY been profitable! I built a stock screener that runs every day and posts the result in my discord channel. so i know which stocks to take a look at. I don't have _crazy_ numbers yet, but currently beating the market by a fair amount. And that feels great!
Richard, this is great in addition to your "interview chat". million thanks:)
Excellent post. M able to learn python and market in the same video 😊
Glad it was helpful!
@@RichardMoglen m able to print dataframe and it prints values but excel was empty initialy, though a little debugging helped. I printed the exceptions and got the solution.
Types of Programs I'd like to create - A really good custom Stock Options Scanner that can either Scrape data from a public site or pull it through a free APi is my main goal. Awesome video by the way - Thank you for this, liked hit the bell and subscribed !
It is a minor thing, and most likely won't affect performance (but maybe readability in my opinion). you could set the condition variables equal to the logic passed as the argument for your if statement. cond1=currentClose>etc...
Thanks for the suggestion Ryan
This is awesome. Thanks for explaining and teaching and also providing a neat template for others to expand on. Great work, and please keep it up.
You're very welcome!
Hi Richard, great video. One question, maybe you gave the answer but English is not my language I could not understand. It can only be done with 5 stocks? Is there any way to scan the rest of the list? Thanks
I checked screener and many more stock filters online but either they were not good enough, i always wanted more features or they were charging a hefty amount. In past i had worked in python and R Programming. So I could understand this all very well. Thank you.. you are genius
Fantastic video. I might have ran into a issue. The code seems to run as it should without any problems according to the text editor but it does not manage to find any stocks that meet the requirements that was set up. So the program does not create an excel file. Have i done something wrong or is it just that it does not make a file if there are no sqreening results?
Very powerful ideas behind this approach. Great content!
Appreciate it!
At around 3:00, it suggested ENPH as the best stock to buy. Note that this stock has doubled since this video has been posted and it's 10/12/2020 now.
Interesting stuff, I am playing with this code now myself after reading Minervini's book.
Some thoughts:
You set moving_average_200_20past = 0 if the try/except fails.
So, if it fails, your condition "if moving_average_200 > moving_average_200_20past" will always be true. Any time that line fails, your stock will pass the test. Because you will have set "moving_average_200_20past" to zero. What if the actual "moving_average_200_20past" was 5 million? And you just couldn't access the data.
Also, the "within 25% of the 52 week high" condition is not 100% correct. It should be within 25%, but not past it. So you need another condition to say that it should not be greater than the 52 week high. It cannot be gone past the 52 week high, because then the current price will be the 52 week high ( a paradox).
Thanks for the great vids as always richard!!
I think for the condition flags you could just do cond_2=(moving_average_150 > moving_average_200) etc to set the flags without the if/else statements, right?
Yes that's right!
Great videos man. I'll try to make a program that captures the maximum drawdown and rally and compares them to their median. That way you can set a trailing stop loss/sell limits that don't trigger with volatility but do trigger on good timing
Nice idea! go for it!
did you ever make that? are you on twitter?
Thanks for the video Richard. I'm really enjoying this video series on Python For Finance.
:)
Looking at these stocks in April 2022, all three of them made huge gains.
Thanks so much for these videos Bro!.... I am new to trading and relatively new to python and your videos are awesome and great teaching.... looking forward to more.
Glad to help!
Your videos are very educational. Great works. Thank you so much.
can i ask what's your source of getting the latest fundamental data sheet? btw, i really love your python for finance series
I download that info from Marketsmith
hi richard! thank u so much for the tutorial! I am looking to create a web app where users can screen for stocks. Python has been amazing, now im looking into how to match the back end and the front end.
Sounds great! Shoot me a link when you get it up
Great tutorial Rich! Thanks for taking time out to make this video!
My pleasure!
Thanks for this video series, this is super helpful for me getting into investing. I do have a couple of questions that i can't seem to fix. I've used the excel sheet you linked to in the description, but the top 5 just prints out "no data on (ticker)". Shouldn't i get the same 2 results as you in the video? Or is it because the data in the sheet you uploaded is more up to date with the current situation and that has caused the stocks to no longer meet our conditions?
I'm so glad you are enjoying the series!
What stocks are in the top 5? You shouldn't get the same results, in fact because of the poor conditions very few stocks should meet the criteria. However most stocks on that list should still have data.
@@RichardMoglen The top 5 is INMH, ENPH, PLMR, VCTR. SEDG. I suspected that might be the case, but this is all new to me so i wasn't sure. Thanks for taking the time to respond!
@@crashie9604 did you ever find out how to solve this? I’m getting the same error message as well!
Hi Richard, thanks for the videos ! Subscribed and liked, really digging your approach....
Could you help me with a traceback error I'm getting for the line "stocklist = pd.read_excel(filePath)" ... ?
It denies the permission for my file path. Why is that?
Thanks Rohit, make you have defined the filepath correctly
Thanks Richard! Great video, I wanted to ask how to make the program scan the whole list of stocks and not only the first 5 stocks.
Have you found the solution?????
@@victorboateng5449 remove .head() from stocklist
Great vid! Thanks for working it out and uploading it!
Any time!
So good man!. It worked. Thanks so much for doing this Richard appreciate it. Have lots to learn on this, I've actually had a few errors when importing the modules, but glad that pip3 install worked fine. :-)
Great to hear!
Great Series Richard- loving and learning with every video :)
Just a quick question- how would we add a sleep.time delay to our code so not to overload the finance API ?
Thanks! Just put it in the loop each time it gets a new stock
Hi Richard, Thank so much for your great share that I’m wishing and dreaming about. I love backtest, stock screen, use model to predict stock price and may be if grab financial index ( ex: ROA, Debt, devidend, eg) Python programming
Thank you for a great video, Richard. I really enjoy this finance series. There is one thing I cannot get working, though.
I would like to create my own input csv file. If I export a portfolio from Yahoo finance, I will have the symbol for the stocks, but what about the RS rating? How do I add that column? Is your input csv file generated from yahoo finance or elsewhere?
RS rating is only from IBD/Marketsmith. For importing CSV files check out this: pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html
Thank you Richard. Does IBD have a API to get the RS rating for each stock ???
Unfortunately not but you can download the data into a spreadsheet
@@RichardMoglen thanks for the reply. Really ? even without a subscription ?
By the way, it would be great if you could covet Point and Figure charts in a similar video. There are plenty of resources to understand how to create them, but I have never come across a good explanation of how to make use of them for possible future stock movement, and moreover how to use them in Python.
Thank you so much! This helps a lot!!!
Glad it helped!
Where do you get the raw excel sheet with all that data? That seems to be the meat of it. Is that exported from IBD somehow?
Yes I export that from MarketSmith
@@RichardMoglen really great videos! Keep them up, subscribed! I was wondering if there are some other alternatives to get similar data as on the MarketSmith one? I wouldn't invest yet $20 for the three weeks before playing with their data.
@@PeterJavorkai_is_on_fire So IBD offers several different products. The regular online subscription includes a stock screener which provides a lot of the same data but with less flexibility.
@@RichardMoglen Thank you, will have a look!
According to you what is the best resource for learning python for financial simulations?
Richard, thank you very much for this amazing content. Totally support you, and keep it coming! A Question please:
I find this line pretty confusing:
df['sma_'+str(sma)] = round(df.iloc[:4].rolling(window = sma).mean(), 2)
why don't just replace it with something like this?:
'df['sma_'+str(sma)] = df.rolling(window = sma).mean()['Adj Close']
Thanks!
Sorry, just as a followup question, why have
for x in smaused:
sma = x
Can't we just do :
for sma in smaused: ?
:)
Thanks!
To answer this question yes I think you can try it out!
I'm not familiar with this syntax but let me know if it works. My line may be confusing because I am also rounding the moving average to 2 decimal places
@@RichardMoglen yes I think the dif is that you're using iloc to index column, I used column name. Also in the video you had iloc[:4] which indexes up to the third row! That's what confused me at first. Of course it is corrected in the scripts you've been so kind to upload to iloc[:,4] to get the third column. Btw i've also found a way to write the if statements in way that takes less code. Will muck around with it, then post it if it works.
Thanks man! Looking forward to your upcoming python tutorials !
@@hamad.learns are you on twitter?
Hello Richard,
I am learning significantly from you...... Thank you for this.
In this tutorial the code works off of your excel sheet to obtain the IBD RS value. I wish to obtain your thoughts on how to establish this value on stocks that are not in your list.
I have wrecked my brains with excel to no avail on how to calculate the IBD RS. Initially I would like to calc it against S&P500, but in the future I would like to calc it on economic sectors (Since I have the data) hopefully to bypass indexes that are tampered with.
Your insights would be very useful to me. Thank you in advance.
Thanks! I get updated sheets from marketsmith every week
Love your videos, however having slight trouble. When I try to run "stockscreener.py" it doesn't execute and says at the very end of its process "Excel xlsx file; not supported". Is there a solution to this?
Change the file type on the downloaded spreadsheet to "xls ". Once you do that make sure you update the filetype in the "filePath" as well. Pandas is not supporting "xlsx" because of some issues with Python 3.9. Best of luck!
Thanks Caleb for the help
@@CalebOsemobor Thank you sir!
This is great Richard. Thank you!! Holy grail set up bounce of 20 day ema would be cool to do on python.
To back-test? What is the definition of the holy grail setup?
@@RichardMoglen For mark's definition is similar to the low cheat or 3c break out. I think the holy grail is from Oneal or IBD...
Great video but I ran into insoluble problem with
stocklist = pd.read_excel(filePath)
stocklist=stocklist.head()
Probably something to do with the filepath I entered? Were we to link to the file in Google Docs. ..... Amateur beginner at work here.
Thanks Richard for yours videos! Them are awesome! Cheers!
Thanks so much!
Hi Richard,
How long should it take a web developer to make a stock screener ?
Richard where do you get the stock list for the file? is it a stock that is traded in usa?
I get it from marketsmith: marketsmith.investors.com/ms-platform/?src=A00587A&refcode=RM_Links
Hey Richard, thanks for the tutorial, it was really helpful. Where did you get the data from in the excel?
Thanks Nathan, I get that from MarketSmith
wish there were more than 1 like button. thanks Richard, you are great
Is there a way to add the current price to the excel output?
The current price would be df["Adj Close"][-1]
@@RichardMoglen thanks a lot man
Hey Richard, great videos by the way. I was wondering if you could upload the raw excel sheet with that data every time you make a video from this playlist because it is very helpful but I'm worried it'll be outdated if I keep using it. Thanks!
Thanks Joe. If you want updated info (such as the RS rating) I suggest getting an IBD online subscription and downloading it from the IBD stock screener.
Thank you for taking the time to write and share this knowledge. You are truly teaching us all 'how to fish.' Question - I am getting that pandas.util.testing is deprecated message (and it looks like you are too). What does this mean, and how would you suggest we adjust for this when we can't use it anymore?
Thanks for watching! I haven't yet found a way to disable the message. To my knowledge this doesn't affect performance in any way. We don't use that functionality.
Thanks , this gives a real head start
Im amazed, really yout should be honored. You got subscribed for sure.
There is just one question behind and ,maybe i didnt get i right because im not native. The data we are using here "Richard All Stocks" its a one time fixed data sheet right? So the datas are not renew by itself right? The programm runs perfectly...but the data sheet behind how get it updated? Which ressource you used for it?So the Excel File Richard All Stocks is based on what?
Thanks a lot
rreally apperciate it
Hey Skott thanks! I get that data from Marketsmith and update it every week: marketsmith.investors.com/ms-platform/?src=A00587A&refcode=RM_Links
@@RichardMoglen wish you all great things in Life. Thanks for sharing and spreading your ideas.
I will work on it.
1449$ thats though :)...would you say by experience its worth for it? just thinking about if there is any open source ..what i dont think so..pitty :)
Hello Richard,
I was wondering how I would be able to gain access to an updated excel sheet.
Hey Kevin, I show how to set that up here:
ruclips.net/video/z0_pozAJZ3M/видео.html
ruclips.net/video/WvvyZEVsGHQ/видео.html
Adding this to my 'to-do list'. Sub'd!
A little late for the book on my Christmas wish list, but I want to create a python program that can change the world.
Hows it going Richard, I was curious where you get these excel spreadsheets with this data? Do you use a python scraper to compile these? If so it would be awesome if you could do a video on scraping stocks for these programs. Thanks again for your work, Liked and Subscribed.
Welcome to the channel! I download these fundamental sheets from MarketSmith: marketsmith.investors.com/ms-platform/?src=A00587A&refcode=RM_Links
Best source for fundamental data!
@@RichardMoglen yeah but 20$ for 3 weeks...
It is free to download?
Richard im a huge fan, but is the excel sheet necessary?Because my computer is kind of outdated.
Hi Noel, no not at all. You could instead define an array of stocks in the python program:
list= ["AAPL","MSFT","FB"]
for i in list:
...
let me know if you have any questions!
@@RichardMoglen instead of that can we pull all the Yahoo Gainers of the day? Like Web Scrapping and use those stocks for day trading?
How can we get an updated version of the excel sheet?
Its really a quality channel. Keep going!
Thank you!
Love these videos! Keep on making them, they are very helpful and insightful
Thanks Ryan! Appreciate you taking the time to watch them!
@@RichardMoglen Question - what source do you use for your stock ranking spreadsheet? Where can I download a current version in the future?
Hi Richard, Is it possible to code a scanner that can be run over all tickers at live market data?
I'm trying to understand the tracking process, Is the process required to import all data from API supplier, then my machine will do the filtring OR my filtering codes would be recognized by API supplier and filter it for me before showing up on my screen?
Thank you
With python you could handle a subset of stocks ~100 but It would take too long to cover much more than that. The way I know how to do it you have to download the data and process it yourself.
@@RichardMoglen
The idea is to make my filtering scan works for only the top 50 of the highest volume, and that changes from time to time! There're tens of live market data suppliers, Any of those would recommend getting the live market data from?
Hi, just wanted to know what packages do I need to run the code. Give me some hours, I am using visual studio. Help
I'm learning Python and would like to know if there is a way to program code that scans the us exchanges live for specific signals to alert me when the 20 day moving average crosses the VWAP? Is this possible?
does the Python scanner instant or does it take a couple of minutes? The reason I ask is I use the 1 min chart and I need instant results and TOS which is the scanner I use now is dynamic and sends alerts every 3 min. which is too slow for me so I am looking for alternatives. Thanks
It is not instant, it has to do all the calculations for each stock. I would check out TC2000's scanner which is the one I use for real time: t.co/TstyZKXiGW?amp=1
Hi Richard, great video tutorials on Python! When I run the code in cmd It returns that there is "no data" per each stock and also that there is "empty DataFrame". Any ideas on how to fix this? Thanks!
the DF is empty coz there is no data :)
Where to get the updated excel?
Hi Richard, I am a bit confused about the way you utilized the if/else code. If all those conditions have to be met, wouldn't you need to use IF/ELIF to check that multiple statements are true?
With how this code is structured they work them same way.
where did this excel sheet with all the tickers and information come from? I.e. how do I get a more current version or will I need to build it myself.
I download it from Marketsmith: marketsmith.investors.com/ms-platform/?src=A00587A&refcode=RM_Links
@@RichardMoglen wow that was fast. Thank you! Videos are great!
@@keving7462 thanks man!
@@RichardMoglen Would you be able to recommend a free website to download similar information as you would have to pay for MarketSmith
Great video and thank you for explaining the code. If I wanted to only get stocks above a market cap of $2 billion and an RSI (14) of 30, how could I do it? I would appreciate the help. Thank you
For some reason, an error pops up in the "file path" line. How do I fix this? Like pycharm can't read the excel data
were you filming this underwater?
This is great stuff, man! I've really enjoyed it so far. Question for you: Since this video is from about three months ago, is the data that we use from the Excel sheet not useful for the current market? In other words, should I try to get newer data before making my investing decisions?
Yeah the data I share is delayed. I get updates weekly from MarketSmith: marketsmith.investors.com/ms-platform/?src=A00587A&refcode=RM_Links
@@RichardMoglen The problem is after the 3 weeks for 19.99 its 149.88 a month fee for their site.
Why did we ignore the index when appending the exportList at the end after the if conditions? Without it (igonre_index=False) it returns an empty list. But I can’t figure out why.
hi Richard - amazing video as always--- could you please share the performance stats over 3-4 months of using this technique pls? ofcourse covid runied lot of plans but would be good to know..
Hi Kiran, this template was created by Mark Minervini, I don't have performance stats related to this method
Richard Moglen sorry Richard- perf stats is probably a wrong word -what I meant is if you have been using this technique to buy in the market ,How have you been doing so far?
Hey Richard seems like i'm getting a bug related to "The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead."
Is there any work around with this?
Hello Richard plz make a screener for Indian share market for live scanning of stocks with volume and price action
.Thank u for videos
Amazing Series Richard!!
I am new to coding but this series has helped me learn a lot but I get stuck only on one thing that is getting a fundamental sheet for indian market.
I have check all the videos and all the sites but unable to get RS rating for indian market.
Could you please help me
Hi, did you ever manage to get RS rating for indian market? Even I'm struggling to find it :)
Why are you using SMA instead of EMA?
One question, do you have the tutorial to build the excel file from yahoo finance data? or can somoone info some useful link please
Where/how did you get the data to make the excel sheet to pull the rsi rating
Hi Richard, Thanks for the great videos! They are very informative and you are great at explaining things step-by-step. Keep up the great work and your channel will become successful. I am curious as to where you are getting the source excel spreadsheet? Is that another custom screener or something that is available to the public? I am not sure how much you use options, but a volatility calculator might be a useful idea for a future series. Thanks again.
Hi Andy, you might want to check out Richard's twitter (@RichardMoglen) where he tweeted about this excel spreadsheet. If I remember correctly the data is from Investor's Business Daily. Hope it helps, I am not sure it is available for free though
@@ValentinLHB Thank you
Thanks for the nice words Andy. I get the data for my spreadsheet from Marketsmith as Valentin said. A Volatility calculator is a great idea thank you!
Hi Richard, thank you for all the videos from Italy! I really appreciate this video. I have a question for you: can I automatically fill the excel input file from yahoo finance or whatever other financial website? Otherwise I should fill the file by myself and it will cost me a lot of time. Thank you for your answer
Ciao Daniele, did you get a solution for this?
@@CozyCrochetLover No :(
hi Richard i am a big fan of you, do you have guide how to export the ticker info into excel? i search this out and found that yahoo had disabled the export function? is it true?
Thanks Siti, could you elaborate on the problem? Is the code I write no longer working? did you use the yf override?
Hey Richard, I am getting an error in my code when trying to read a spreadsheet from chart mill, the error is
Traceback (most recent call last):
File "C:\Users\avery\Documents\StockScreener.py", line 28, in
RS_Rating=stocklist["RS_Rating"][i]
File "C:\Users\avery\Documents\lib\site-packages\pandas\core\frame.py", line 3024, in __getitem__
indexer = self.columns.get_loc(key)
File "C:\Users\avery\Documents\lib\site-packages\pandas\core\indexes\base.py", line 3082, in get_loc
raise KeyError(key) from err
KeyError: 'RS_Rating'
Also when I scan your excel sheet it only gives me 4 stocks, is this normal? Thank you
Hi Richard. I'm interested to know how the results from your screener differ from the Mark Minervini screener that's native to Market Smith? Thanks.
Hey Richard, They should be nearly identical, although the MarketSmith screen can sample the RS rating straight from their database and has a different time settings
Thanks@@RichardMoglen . If I want to run this on a list of stocks from, say, Hong Kong or China exchanges but don't have an RS rating, do I need to remove any lines of code? I realise this wouldn't strictly meet Minervini's criteria, but it would be a start! Thanks.