How to Invest with Data Science
Ask me Anything Anytime on Twitter: x.com/NewThinkTank
In this One video I'll explain how to invest using cutting edge knowledge from both technical analysis and portfolio optimization. I'll be covering all of the following :
✳️ Downloading Stocks
✳️ Daily / Cumulative Returns
✳️ Bollinger Bands
✳️ Moving Averages
✳️ Ichimoku
✳️ Candlesticks
✳️ Complex Plots
✳️ Sector Analysis
✳️ Markowitz Portfolio Optimization
✳️ Correlation / Covariance
✳️ Efficient Frontier
✳️ Sharpe Ratio
✳️ Portfolio Weighting
✳️ Much More (This is the Longest Video I Ever Made)
The Files are here here github.com/derekbanas/Python4... (Look for the 5 files that begin with Ultimate and the file named big_stock_sectors )
MY UDEMY COURSES ARE 87.5% OFF TIL February 13th ($9.99) One is FREE
➡️ Python Data Science Series for $9.99 : Highest Rated & Largest Python Udemy Course + 56 Hrs + 200 Videos + Data Science bit.ly/Master_Python_46
➡️ C++ Programming Bootcamp Series for $9.99 : Over 23 Hrs + 53 Videos + Quizzes + Graded Assignments + New Videos Every Month bit.ly/C_Course_46
➡️ FREE 15 hour Golang Course!!! : bit.ly/go-tutorial7 (100 Available)
❗ THIS IS NOT INVESTMENT ADVICE ❗
I'm not implying that investing this way will guarantee anything. All investing is risky and you should always take advice from someone who can assess your specific situation. THIS IS FOR EDUCATIONAL PURPOSES ONLY!
MORE DATA SCIENCE VIDEOS
Install for Windows : • Install Anaconda Windows
Install for MacOS : • Install Anaconda MacOS
Numpy / Pandas / Plotly in 1 Video : • Python for Data Science
NumPy in One Video : • NumPy Tutorial : Numpy...
Pandas in One Video : • Pandas Tutorial : Pand...
Matplotlib in One Video : • Matplotlib Tutorial : ...
Seaborn in One Video : • Seaborn Tutorial : Sea...
Plotly in One Video : • Plotly Tutorial 2023
Time Series Analysis : • Time Series Analysis
Probability in One Video : • Probability for Data S...
Statistics in One Video : • Statistics for Data Sc...
Algebra : • Learn Algebra
Linear Algebra : • Prelinear Algebra
Пікірлер: 310
You're a blessing to the dev community. This generation is really lucky to have you. I hope people realize that.
@derekbanas
2 жыл бұрын
Thank you for taking the time to write such a nice message :)
@7th.Chosen
Жыл бұрын
absolutely agreed! Derek rules
You're truely the one of the most impressive human beings I've seen im my life.
@derekbanas
2 жыл бұрын
Thank you for taking the time to write such a nice message :) I greatly appreciate it!
@brooksgunn5235
2 жыл бұрын
Wow, this is gonna be in my vows.
@MithunDuttaIL
2 жыл бұрын
I have learned so much from him. A true Guru.
You spent almost 4 months studying, and you recorded this while sick with COVID, honestly thank you so much. Hope your fully recovered by now. My friend and I are watching this video and learning a lot. Thank you so much, always look forward to your stuff. Have a nice day.
@derekbanas
2 жыл бұрын
Thank you :) Yes I feel better right now. Thank you for asking. I'm happy you and your friend enjoyed it
Excellent video, as always, Derek. I always learn something new when I watch your videos. 👍🏻
@derekbanas
2 жыл бұрын
Thank you very much :)
Derek your videos have been integral to my professional and personal growth going back years.... I cannot thank you enough sir.
@derekbanas
2 жыл бұрын
Thank you for taking the time to write such a nice message :)
Thanks a lot, Derek, I have become a fan of your channel. Your explanations are clear and the pace is perfect. God Bless You!
I cannot wait to go through this along with you! I went through this journey two years ago and built my own version of this. I am very much looking forward to seeing how you've solved the problem and what I can learn along the way!! Great work!! And I'm definitely going back to see some older videos as well ;)
@derekbanas
2 жыл бұрын
Thank you :) I hope you find it very useful
Hey Derek thanks or making videos. I have watched a lot of your programming video tutorials while I was studying at the university. It helped me a lot. Thanks
@derekbanas
2 жыл бұрын
Thank you :) I'm very happy you have found the videos useful
@Derek Banas, thank you for taking the time to put this together. This is truly awesome.
@derekbanas
2 жыл бұрын
Thank you very much :)
I came back to this channel for nostalgia you were the real OG when I did computer science in College. I really appreciate all the great work that you have done in your channel.
Derek this is the first video I’ve seen with your face to it lol. Just a quick shout out for your amazing work. I will have to find some time to dive into learning this one. Thank you again
Wow! How very lovely to finally put a face to the voice of my favorite Java tutorials!
Truly appreciate your patience and effort to selflessly teach financial and programming concepts.
@derekbanas
Жыл бұрын
Thank you for the nice message :) It is my pleasure to be able to help.
This was a real marathon, but I learned a lot from this video. Thanks for powering through it while sick and for bringing a great sense of humor along as well!
@derekbanas
2 жыл бұрын
I'm very happy that you enjoyed it! This was both terrible, but also so wonderful to make. The community all came together and helped me to keep pushing on. This is probably the most fun I have ever had making a video on KZread. It is the reason why I'll probably focus on livestreams from now on. I'm very thankful for the friends I have met online :)
@felipebulac
2 жыл бұрын
@@derekbanas Of course! Looking forward to your next Twitch stream.
Thanks for posting class 1 stuff. Always. Someday It will be interesting to expand this video with options trading using Data Science like you did in this video. But again thanks for all your work. Your community has nothing but to appreciate every stream.
Really thanks for that tutorial Derek, I appreciate it.
@derekbanas
2 жыл бұрын
Thank you :) I'm happy you enjoyed it
@Derek Banas, wow I’m planning to watch this video more than once. So much knowledge here, big fan as many here you made part of my student and professional life. I understood Java because I watched all your videos.
@derekbanas
2 жыл бұрын
That's awesome :) Congratulations on all you accomplished
Just wanted to say thank you for your time and knowledge!
Thanks a lot, Derek!! God bless you!
MY UDEMY COURSES ARE 87.5% OFF TIL JANUARY 25th ($9.99) ➡ Python Data Science Series for $9.99 : Highest Rated & Largest Python Udemy Course + 54 Hrs + 200 Videos + Data Science bit.ly/Master_Python_22 ➡ New C++ Programming Bootcamp Series for $9.99 : Over 23 Hrs + 53 Videos + Quizzes + Graded Assignments + New Videos Every Month bit.ly/C_Course_22
Been going through this for fun. I really appreciate all the content you make
@derekbanas
2 жыл бұрын
Thank you very much for the compliment :) I'm happy I could help
The kind of quality material I like to watch in youtube, amazing!
@derekbanas
2 жыл бұрын
Thank you very much :)
Wow! I learned a lot from your videos as i made my master. You combine so many toppics i‘m in love with. Thank you very much for your greath work! You are such a nice and intellegent guy. Get wel soon. Best regards from switzerland
@derekbanas
2 жыл бұрын
Thank you for taking the time to write such a nice message :) I appreciate it! I'm happy you enjoy my wide variety of videos.
I'm so stoked for your ML course
The master is back. Hope you're feeling better! awesome coding session, thanks
@derekbanas
2 жыл бұрын
Thank you :) Nice to see you again! The covid still has me sadly
Thank you for an amazing video! Subscribed 🎄
Just watched the begining and what I've seen is superb 😊 thank you
Derek, thank you for this great video. Can't believe that you are providing such a valuable information for free. Since you are about to do machine learning, may I suggest you think about creating a video of short term trading based on LSTM like Renaissance Technology was doing, and also show us how to connect to brokerage's API and do the algorithmic trading.
Hi Derek, hope you get well soon. You've been amazing teacher for learner like us. Hope you'll be very good very soon! :) I've following you since 2014, watching each of your videos! I remember you got the job at Apple when you were 16. Just out of curiosity, Can I know, where are you working currently?
@derekbanas
2 жыл бұрын
Thank you very much for the support. I was actually hired by Apple when I was 20. Currently I'm a consultant. I make online stores and act as an inventory analyst
Hey Derek, I have been watching you since 2015. Keep it up, cheers man.
@derekbanas
2 жыл бұрын
Thank you very much :)
You are a legend 🙌🏾 new subscriber!
A truly spectacular video! As a Principal Data Scientist at a Forbes 5 publicly traded company, I applaud your presentation and attention to detail. As this content primarily applies to short to medium term swing trading, it would be interesting to see strategies, ML models, and insights into momentum day trading of highly liquid stocks.
@derekbanas
2 жыл бұрын
Wow thank you for taking the time to give me such a wonderful complement :) I greatly appreciate it. It is always nice to know that people in the industry approve of my work!
that constant PATH you used for calling has opened up everything for me! thank you
@derekbanas
2 жыл бұрын
Thank you for taking the time to say you liked it :)
Google recommended this to me...Oooh God, how i needed this with my life....amazing video Ever! Thank you man for giving us something that has extremely high value, that isn't even available at the university...FOR FREE! You got a new loyal Subscriber/Fan!
@derekbanas
2 жыл бұрын
Thank you very much :) I'm very happy you enjoyed it. It makes me happy to give away all of this stuff for free
@daemon2880
2 жыл бұрын
@@derekbanas God bless you good Sir!
😮 this is incredible. I came for the experience but I was caught off guard by the shear volume of information! I hope you recovery quickly mate! Take care of yourself.
He made it again !!! Amazing thank you so much Derek.
@derekbanas
2 жыл бұрын
Thank you :)
I'm speechless :) Thank you, Derek!
@derekbanas
2 жыл бұрын
Thank you very much :)
Thanks a lot and get well soon Derek!
@derekbanas
2 жыл бұрын
Thank you very much :)
holy cow. As a data scientist, this video is gold. I understand the DS side of it, but you do a great job of explaining the stocks side of things.
@derekbanas
2 жыл бұрын
Thank you very much :)
Thank you very much for this and all your other videos.
@derekbanas
2 жыл бұрын
Thank you :) I’m happy you enjoy them
Just stumbled across this, just wow ..! Thanks Derek
@derekbanas
2 жыл бұрын
I’m very happy you enjoyed it :)
learn a lot from your videos, i am grateful that i found your channel.
Thanks for this excellent video, take good rest and get well soon. 🙏🏻
@derekbanas
2 жыл бұрын
Thank you :) I'm happy you enjoyed it
Derek is mine of knowledge.. Thanks
Thanks much appreciated, this is truly a GEM
@derekbanas
2 жыл бұрын
Thank you very much :)
Nevermind, i hadn't understood the convention. Great video!
Hello Derek, im Ricardo from Brazil (ignore the Pittixixito name, lol), i really love and appreciate ur job my english is not so good but i want express all gratification about ur videos, thank you so much for ur effort! big fan here
@derekbanas
2 жыл бұрын
Hi Ricardo, Thank you so much for taking the time to tell me you enjoy the videos. I'm learning Spanish / Portuguese right now and I hope to make videos in those languages some day :)
I can't believe I went through all of this... took me a week but I did it! Thank you very much for posting it, it is a shame that it ended so abruptly, but I'll blame covid for that :D I am experimenting with the code and trying to adapt it to my needs. Checking if the portfolio converges. Thank you again (and the youtube algorithm for letting me know you existed hahahah) Checking your other videos definetly!
@derekbanas
2 жыл бұрын
Thank you :) I’m very happy that you enjoyed it. Sorry about the end. Yes I had covid and I knew I was going to completely lose my voice in a few minutes, so I ended it the best that I could. All of the code is on GitHub for free
@Kaletho
2 жыл бұрын
@@derekbanas I saw it, although I preferred to type it and (try to) understand it. I'm playing now to see if the portfolio converges! haha
As always, thank you for such valuable content. I just started learning elixir and I’m so glad I found your tutorial. Any plans on doing a phoenix and liveview tutorial?
@derekbanas
2 жыл бұрын
Thank you :) I’ll see what I can do
You are extremely generous. Thank you so much.
@derekbanas
2 жыл бұрын
You’re very kind :) It is my pleasure to help
Woah...looking forward to watch this video in one sitting. Thanks man, really appreciate your efforts.
@derekbanas
2 жыл бұрын
It is the BIGGEST and LONGEST video I ever made! On top of that I was super sick with Covid. Everyone that attended the livestream pushed me to the end. It was fun!
@ramanthakur1105
2 жыл бұрын
@@derekbanas thankyou for your hardwork brother wish you great health 🙏❣
@derekbanas
2 жыл бұрын
Thank you :) I wish you good health as well
you have provided me with an abundance of wealth, both monetary and mental. Thank you so much.
@derekbanas
2 жыл бұрын
Thank you :) It has been my pleasure to help
This video is too good to be on KZread. Those 3 hours are worth more than my 2 years of college as a data science major
@derekbanas
2 жыл бұрын
Thank you for such a nice compliment :)
Another good one. Keep em coming!
@derekbanas
2 жыл бұрын
Thank you :) Machine learning is coming next
Wow, super awesome!!! Exactly what I am interested in!!
@derekbanas
2 жыл бұрын
I’m very happy you liked it :)
Loved the video. Get well soon. ❤️ I'm still hooked with your invisible cup lol 😂
@derekbanas
2 жыл бұрын
Thank you :) I have to put that invisible cup on the Merch Store :) Kidding
Excellent videos. Anyone who has records and a turntable is OK. Hope your feeling much better.
Found your channel 3 hours ago and I am still watching!! Just Amazing
@derekbanas
2 жыл бұрын
Thank you very much for taking the time to tell me :) I'm happy you are enjoying the investing videos
Hi Derek, thanks for the great video and explanations! At 02:40h you go into volatility, etc. Do you have an idea in which literature the equations or the definition of such values can be found? An overview (summary) of the frequently used equations would be great. Thanks very much!
thank you for this video!
Hey Derek, love the vids really informative. Just wondering, how do you get the future Ichimoku clouds to appear at the end of the plotly graphs? Like the ones on trading sites. Thanks for all the videos, you legend!
Thanks for doing the video. I hope you feel better.
@derekbanas
2 жыл бұрын
Thank you :)
Brilliant ! Thank you so much !
@derekbanas
Жыл бұрын
Thank you :) Happy to be of help
Well, it's been long since I came back to you Derek. You always make crazy videos interesting to watch. My question is, how are you getting time to learn new things. You are incredible as always.
@derekbanas
2 жыл бұрын
Welcome back :) Thank you for the compliment! I don't sleep very much and I also have a job (Data Science / Machine Learning) that has many moments were I perform long calculations that take 10 to 20 minutes to complete. While that is happening I pick up what ever I'm currently learning. Currently I'm learning the guitar. I have an interesting and unique life.
@arunbeckham8384
2 жыл бұрын
@@derekbanas sounds great Derek. You are becoming Dr. Romantic now😁. You are doing job and uploading videos on KZread and also following your new hobbies. I think you don't like wasting time in life. You are self disciplined person.
Derek, when using the Ichimoku Cloud for making trading decisions, don't you need the Cloud to extend 26 periods ahead of the current Price data? Your coding example cuts the cloud off at the latest Price data.
Awesome. Learned a lot of new stuff today!! Greetings from Denmark!
@derekbanas
2 жыл бұрын
Fantastic! I'm happy you enjoyed it
@EsbenKielS
2 жыл бұрын
@@derekbanas I ran into a little problem. Maybe you can guide me. When trying to do like this: ticker = 'AMZN' stock = yf.Ticker(ticker) df = stock.history(period="5y") I keep getting an error: df.index = df.index.tz_localize("UTC").tz_convert( AttributeError: 'Index' object has no attribute 'tz_localize' How do i fix this? Thank you 😃
vidio is very good..tq
Thanks for doing this tutorial while you’re sick.
@derekbanas
2 жыл бұрын
I’m happy you enjoyed it. I couldn’t have done it without the help of those that were there asking me questions. I was exhausted and lost my voice thought at the end.
Excellent video. Thank you.
@derekbanas
2 жыл бұрын
Thank you very much
Oh baby, this is exactly what i was looking for.
@derekbanas
2 жыл бұрын
Happy I could help :)
Hello Derek, thank you for this great lesson, in minute 38:55 does the span-A need to be shift 26 sessions forward like you done with span-B ? regards. Tom
Great video! Question: isn't something wrong with the Span B? Either the definition or the code chunk? Seems weird to me :s
What a great video, literally a beginner to a hedge fund manager tutorial.
@derekbanas
2 жыл бұрын
Thank you for the nice compliment :) It was fun to make
Thank you for this video.
@derekbanas
2 жыл бұрын
Thank you :) I'm very happy that I could help
Hope you get better soon! Been following your channel for really long time! Go Dodgers! If you're in LA, I'd be down to get some tacos someday!
@derekbanas
2 жыл бұрын
Thank you :) No I don’t live in LA. I’m freezing in Pittsburgh :(
Awesome video. Praying for your speedy recovery. Thanks a lot.
@derekbanas
2 жыл бұрын
Thank you very much :)
Would love to see a "build your own trading bot" video from you Derek!
@derekbanas
2 жыл бұрын
That would be rather easy with everything I covered here, but that is a powerful weapon you don't just hand to anyone
thanks for posting this
@derekbanas
Жыл бұрын
I'm very happy that you liked it :)
Thank you for your effort. Greetings
@derekbanas
2 жыл бұрын
Thank you very much :)
All I can say is you are a true genius and guru. God in true sense
Unbelievable. A genius sharing his skills for free.
Nice to meet you!
This video helped me make my diploma thesis for my msc degree thanks cheers 🍻
@derekbanas
2 жыл бұрын
That’s awesome! Happy I could help
Derek, awesome learning format. I thoroughly enjoy your python videos. Question: Instead of having an End date, how can we append new data without downloading the entire data set?
@derekbanas
2 жыл бұрын
Thank you :) 1. You'd have to save the date for your last download. Then fetch only the new data using the date data = yf.download("AAPL", start="2022-05-18", end="2022-05-20") 2. Get your saved csv data as a dataframe. get_stock_df_from_csv(ticker) 3. Then concat the new data to the end of the old data dataframe and save to csv pandas.pydata.org/docs/reference/api/pandas.concat.html#pandas.concat
Thanks for sharing this. I hope you are fully recovered from covid. I see you presented some tools and showed how to create them in Python. But regarding the portfolio, I was wondering how the decision making process works for selecting the stocks. In the video you came up with a random portfolio and computed the percentages of each stock. But I would like to see what makes you pick a particular stock. Is there a video on that? Thanks.
@derekbanas
2 жыл бұрын
Thank you :) I'm feeling better. All the tools are here to do what I do. I get a list of the best sector stocks over a 5, 3 and 1 year period. I then run ichimoku on them and look for stocks from each sector with strong momentum. Then I create an efficient portfolio with those stocks.
Junior dev here. Building a portfolio project and have been overwhelmed learning data science. This video will help me so much!! Can't thank you enough 🙏🏾🙏🏾🙏🏾
@derekbanas
2 жыл бұрын
Thank you :) I'm very happy that it helped. Up next I'll explain machine learning in an easy to understand way
Derek, we are praying for your speedy recovery. Maybe if you feel like it, you can keep your viewers up to date on what you are going through so we know what to expect because we will all get it eventually?
@derekbanas
2 жыл бұрын
Thank you :) I pray nobody gets what I got! I caught the original covid in February 2020. That developed into Long Covid, which means you pass out all of the time and feel exhausted. There is no cure. Yes I got vaccinated. Now I caught omicron. I’d make a video, but I think a lot of people would ask me for solutions, which I don’t think would be useful since I’m not a doctor and I know a lot of doctors, because I went for treatment for long covid and they tell you straight up that they don’t know how to treat this disease and that they are just experimenting. I wish everyone the best of health and I hope some day we can get rid of this.
@benjamindilorenzo
2 жыл бұрын
@@derekbanas there is actually a heart medication that is used off label to cure the long covid symptoms. check that out, its still in the testing phase, but it had good results here in germany.
@andrews3320
2 жыл бұрын
@@benjamindilorenzo ivabradine?
Bravo!!
Thanks a lot your are a good man
@derekbanas
2 жыл бұрын
Thank you for taking the time to write a nice message :)
Great video thank you
@derekbanas
2 жыл бұрын
Thank you :)
You look exactly like how your voice sounds. You are fantastic.
Incredibly helpful video. Thank you!! Do you have any book/ other similar resource recommendations for a beginner to get a good grasp on investing?
@derekbanas
2 жыл бұрын
Thank you very much :) The book I recommend is simply called Investments by Bodie amzn.to/3IQTjdi It covers most everything you could ever want to know. It is a textbook
Hello Derek. Great video as always. Do you have any suggested resources to understand these concepts from a Mathematical standpoint?
@derekbanas
2 жыл бұрын
Thank you very much :) Next week I'll start making learn in one videos for Algebra, Trig and then calculus
Ho my I just found a nugget! thanks a lot!
@derekbanas
2 жыл бұрын
I'm very happy I could help :)
Derek, you are the man
@derekbanas
2 жыл бұрын
Thank you :) I'm happy I could help
Did you fix the error during your first break? I was surprised that you can plot the AMD Bollinger band, cuz apparently new_df.to_csv(PATH + 'A' + '.csv') is incorrect, you save all the new dataframe to 'A.CSV'
@thriller718
2 жыл бұрын
Yeah, I noticed that too. It should be new_df.to_csv(PATH + x + '.csv')
Thank you for the all videos Derek and loved your Udemy Course. Is it possible to make a video where we can write the stock data directly to a DB and have a cron job to regularly update. Once the data is in a DB we can use various functions to analyze stock data
@derekbanas
2 жыл бұрын
I'm happy you enjoy them and thank you for the support by getting my Udemy course :) Sure this is basically Python with a bunch of libraries. You can do exactly what you said
Hi Derek, 1st off, don't die! That is not an option. You're way too precious and important to us. I hope you get better soon. The secret is to just sleep as much as you want and need. if you need to sleep 20 hours a day for the next, few months, do it! Let your body rest and repair. The more rest you get the sooner you'll recover. Secondly, what you needed here as an intro is a parody of Tai Lopez. There you are, just standing in your garage, in front of the Lambo (The Banas's Lambo = The Bambo!) talking to us about investing. Maybe wear a t-shirt of Tai with the caption, "This is the man we'd like to be" On a serious note, I am seriously going to enjoy your series on investing, programming and machine learning. My favourite, living scientists are Doyne Farmer and Norman Packard. Those guys have lived a life the rest of us can only dream of; trying to beat roulette in Vegas with a computer in a shoe, using chaos theory to predict the stock market. Check out the book, "The Eudaemonic Pie" if you can, one of my favourites along with "Chaos" by James Gleick. This series will be of that ilk. Let's beat the system!
@derekbanas
2 жыл бұрын
Thank you very much :) That's funny! I don't have anything fancy. I save all of my money. A Lambo would be pretty cool though! I'll definitely check out the books.
You need to be above an average human in order to make videos like these in such COVID situations. Hope you get well soon. Loved it
@derekbanas
2 жыл бұрын
Thank you for the nice wishes :)
Tremendous work
@derekbanas
2 жыл бұрын
Thank you very much :)