Simple Stock Recommendation System based on Technical Trading Indicators (ta) using Python & SQL
HTML-код
- Опубликовано: 21 май 2024
- Thanks for watching :-) If you enjoyed the video please subscribe.
This video is showing how to build a very simple stock recommendation system with Python based on technical trading indicators such as MACD and RSI / SMA using the ta library.
Be kindly invited to let me know if you find stuff like this interesting.
Get the Notebook/Source code by becoming a Tier-2 Channel member:
/ @algovibes
Video on building a finance database:
• Create your own Financ...
Video on dataframes and sql:
• Pandas Dataframes and ...
Video on MACD:
• Algorithmic Trading in...
Video on RSI / SMA:
• How to build a RSI Tra...
Disclaimer: This video is not an investment advice. It is for educational and entertainment purposes only.
0:00 - 01:36 Explanation of what is going to be done
01:36 - 02:42 Recap of the SQL database
02:42 - 04:35 DataBase connection & getting table names
04:35 - 06:25 Get actual price data out of the database
06:25 - 09:25 MACD function (using ta library)
09:25 - 11:40 RSI / SMA function (using ta library)
11:40 - 12:57 Apply the technical indicators to all stocks
12:57 - 15:28 Result: Which stocks to buy? (no investment advice)
15:28 - 17:53 OPTIONAL: How I updated the database
17:53 - 19:15 OPTIONAL: Daily update of the database
#Python #Trading #Stocks
I have no regrets in saying that u r the best youtube channel regarding 'Python for finance'
There are surely a lot of other great ones but I highly appreciate your kind comment :-)
Agreed...its easy to tell the ones that just copy others work.
Another example of elegant finance programming. You make it look so clean and efficient. Well done and hope to see the full scale version.
Thanks a lot for your kind words and your feedback. Anyhow it is important to me that people understand there is some preparation behind my videos. The work process is usually looking like this: Have an idea -> code it -> test it -> review it -> simplify it so that even people with little coding background can follow along. I am sometimes improvising while recording but trying to stick to my prepared code.
Even if it looks smooth I can assure you from time to time I have some pain here and there while preparing the code :-)
@@Algovibes thank you for replying and for being honest about the pains of programming. For me, sometimes one line of code locks me in a jam and it gets frustrating as I feel I am wasting time. But in the end when it works I feel happy at my success. I am always glad to see your work as it is very informative and educational and I appreciate you dedicate a lot of time not only for the development of the programs but also to understand finance and to create the video/educational material. I thank you sincerley and wish you best of luck with your programming.
Love your step-wise refinement of the code. Helps us newbies to keep up with the concepts. Many thanks!
Thanks a lot for watching my stuff mate :-)
Im python newbie and your videos are great source of knowledge for me. Thanks!!!
Great to have a real thug on board. Increases my street credibility. Jokes aside: Thank you very much for your support. Appreciate having you on my channel :-)
this is the video i was waiting for since i subbed you. thank you for the great content.
Thank YOU for watching, your kind words and subscribing. Really appreciate it :-)
Your content is pure gold. Thank you!
Thanks for your support! I really appreciate having you on board :-)
You're amazing bro thanks for uploading these!!
Thanks for watching and your comment buddy :-)
Thanks a lot for wonderful explanation for using python for finance. Really helpful and please keep up good work
Thank you my friend :-)
Very nice of you. Thanks.
Very nice of you comment :-) Thanks for watching!
Great content, simple explanations very much interested more similar contents
Thank you very much for watching and your feedback :-) Appreciate it.
yes,.... definitely wanna see the heavy weight version too!,,
Awesome! Thanks a alot for your feedback.
First on RUclips for this topic ! Great efforts . God bless you !
Thank you very much for your support :-) Really appreciate your contribution!
Awesome work.
Thank you man!
Great men............ this is owesome video
Thanks for your kind words :-)
Perfect, thankx
Thank YOU for watching and your appreciative comment :-)
I like so much this idea! TBH I'm very very interesting in this topics. Very helpful! Yeah...as someone said "u r the best youtube channel regarding 'Python for finance'"!! Just a challenge for you...what about make the same video using Fib retracement, support resistance level (e.g. when a stock is near to a support level) or candlestick pattern (doji, hammer etc...) ?
Thanks a lot for your kind words Enrico! Also thanks for the suggestions.
super mate,make more like these
Thank you very much for watching and your kind comment mate. Appreciate it! Investing my spare time to produce more whenever I can :-)
Complimenti ottimo lavoro. Grazie
Understood the second part but had to translate the first part :-D Grazie mille for your kind words. Appreciate it :-)
@@Algovibes Good job. Tks 😀
great job
Thanks for watching and your kind words :-) Appreciate it!
More great content. Keep up the good work. Can you show how to set up a cron job so the database is updated after market close every day?
First of all thanks for watching and your comment :-) Cool suggestion, thank you! Will see if I am doing it in a separate video or in the recommender one.
great content
Thank you mate.
Thanks for another great tutorial, informative and educational. As a beginner I am finding it easy to understand. Can you make a video on buy recommendation based on SUPERTREND Indicator?
Thanks for your feedback, truly appreciate it! I am doing my best to produce content which is accessible for beginners but also interesting for experienced people. Thanks for your suggestion regarding supertrend. Will see what I can do :-)
@@Algovibes many thanks for your reply. Waiting for more new tutorials.
Hi, I'd like to first salute your work. Its been an immense resource on my path. I attempted implementing your example but keep getting the following error "AttributeError: module 'pymysql' has no attribute 'install_as_MySQL_db'"...
Are there any pointers you have that may help me resolve this error? Thank you
love it
Incredibly happy to hear that :-) Thanks for watching.
Great Video! Would be interesting to implement an ai, to figure out what a buy signal is, Instead of coding it. keep up the good Work!
Haha yes :-D I am trying to cover some more Machine Learning as well.
I have planned on implementing a simple logit regression - link: ruclips.net/video/X9jjyh0p7x8/видео.html in the larger scale stock recommender.
helpful
Happy to hear man. Thanks for your comment!
Please consider doing a cross sectional momentum/ accelerate dual momentum strategy since your channel is kind of about quant trading
Thank you very much for your suggestion! :-)
I will see what I can do. I covered a lot of momentum strategies in the last time and don't want to bore the people :-D Dual mom is on my list.
What a great content and crystal clear video!
I've successfully replicated the steps in the video to about 700 stocks, however the issue is speed: it took 13seconds for all the process to complete.
Is there anything can be done to speed up the process where speed is essential?
I'm thinking of just let the stock prices for all stocks in 1 Dataframe and then use applymap function so this way we avoid the for loop.
I got the idea in my head from watching videos on vectorization and efficient pandas, but I don't know how to put it out code-wise and get it done LOL..can you help in a short update video how to speed up the process?
Thanks!
Thanks a lot man!
Yea vectorization would be my first guess as well.
Maybe I am covering a similar topic in the future, yes. But I didn't plan on that yet.
Use VectorBT library, which is my go to for these cases. Moreover in other cases you can use feather library for other formats.
another great video sir, pls add how to update live data in SQL in a live market and then fetch data and put indicator and place order in the live market or search stock matching our entry and exit condition.
Thanks a lot for your feedback and the suggestion! :-)
Thanks for the video I am also locking for
Thanks very much for great video
My request to you please make video on how to update database automatically every day after market closing.
Thanks for watching buddy :-)
I have already covered that here:
ruclips.net/video/FkZNUj36Jcc/видео.html
In a nutshell you can set up a cronjob which should be executed after the market close.
Video on cronjobs:
ruclips.net/video/uEn1uZtPMzw/видео.html
Thanks for really I will check
What do you think about the probabilistic momentum?
Was stumbling over it some time ago and just had a refreshing read.
Thank you very much for sharing - sounds incredibly interesting. Definitely will test that on my own. Maybe releasing something about it in the future.
Do you already have some insights you want to share? Would really appreciate an answer!
What is the difference Sqlalchemy and Sqlite3? In the first video, you started with sqlite3 and then shifted to sqlalchemy.
You can use a bunch of SQL systems (sqlite, mysql, mssql,...) with sqlalchemy. More info here: www.sqlalchemy.org
@@Algovibes df.to_sql(name,engine, if_exists='append',index=False). This code duplicates the data written in the database during data feed, if it worked 2 times. How can it be solved? or Should it be solved? What happens if I have several rows with the same date and price data?
Eagerly waiting for the heavyweight one my man🤜
Thanks for watching and your feedback :-) Helps me a a lot!
I will see that I am releasing it soon.
This tutorial is for MAC OS. Can the same code and technique be used for Windows OS?
Hi Meghan, No this tutorial is not using anything related to MacOS. Can you elaborate? Should work the exact same way on a windows / linux machine.
@@Algovibes Actually you pretty much cleared the doubt. I just wanted to know if the code is runnable on Windows OS.
Value error index scaler error how to resolve this
Add on a feature that it should give a notification on email.
Awesome idea! Can't promise to include it but if it fits in I will see what I can do :-)
Also try to add EMA conditions
I saw your kind comment which was blocked (for whatsoever reason) and I want to thank you alot for your kind words :-)
Can you please specify what you mean with EMA conditions? The EMAs are already included when using the MACD diff or am I getting you wrong?
@@Algovibes you must add on a feature in this script... Which gives notification on email. .. when is a bit and sell ... And by ema mean the Crossing of ema lines like in pine script which gives buy and sell signals . I hope you make it ❤️
All the best... Waiting for your next video .
Yes I know technically how to program it but need to see if a email notifier fits in in terms of length of the video :-)
@@Algovibes I do have some accurate values for intraday buy and sell signal ..
Hope those might help you... But those are in a pine script !
@@Algovibes it would be really helpful if you share EMA and email.
Do you have any github handle?