You are the most knowledgeble willing to show other how to do this. Im so thankful!
@Algovibes Жыл бұрын
Thank you so much for leaving such a nice comment :-)
@hsider3 жыл бұрын
Simple but satisfying strategy 🤠
@Algovibes3 жыл бұрын
Well that sounds perfect :D Thanks for watching and your comment. Appreciate it!
@eagleman50633 жыл бұрын
Great video, bro. If you have a course, I'll enroll on it! Thank you for including the references on this vid. You're amazing.
@Algovibes3 жыл бұрын
Thank you so much Paul :-) Appreciate your kind words. I'll let you know once I made one :-P
@BinhKieu823 жыл бұрын
Hi Algovibes, I really enjoy your videos, simple approach but extremely efficient. Could you make a video that combine two alpha factors: momentum & mean reversion please, thank you
@Algovibes3 жыл бұрын
Thanks again :-) I still want to cover Mean reversion. Didn't cover it yet but it's on my list since one year now :D
@p8queen3 жыл бұрын
awesome!!
@Algovibes3 жыл бұрын
Thanks for your feedback :-)
@DarrylHebbes3 жыл бұрын
Dankeschön
@Algovibes3 жыл бұрын
Bitteschön
@SantoshLLC3 жыл бұрын
Thanks!
@Algovibes3 жыл бұрын
Thank YOU! :-)
@cooltraderf3 жыл бұрын
Really great and concise too. The monthly returns adjusted by their standard deviations (volatility) for the reversal returns would be an interesting additional step. I just subscribed to your channel. Thank you.
@Algovibes3 жыл бұрын
Hi and welcome! Thank you for your subscription. Appreciate it! :-) Also an interesting suggestion. Thanks a lot!
@ihebbibani71223 жыл бұрын
Hello , for what purpose are using that calculation inside the agg() function ? Thank you
@Algovibes3 жыл бұрын
Hi :-) To cumulate the returns over one month. I have explained cumulative returns here, be kindly invited to check it out: kzbin.info/www/bejne/nIirgqqniZifhLs
@SP-db6sh3 жыл бұрын
Now you should initiate a pro quant course ! Salute sir !
@Algovibes3 жыл бұрын
Maybe some day. In fact my long term goal is to teach programming/finance topics - one of the reasons why I started KZbin. I appreciate your comment and thank you very much for watching :-)
@SIMONONLY3 жыл бұрын
any diff between prices.pct_change()resample('M').sum() and .agg(lambda x:(x+1).prod() -1)
@Algovibes3 жыл бұрын
Yep. A big difference. I have explained it in this video here: kzbin.info/www/bejne/nIirgqqniZifhLs Let me know if this is clarifying for you!
@lucksimi33203 жыл бұрын
Hi How to get the 1 month low and get an sms alert when price above 1% of the 1 month low, thanks
@Algovibes3 жыл бұрын
Thank you buddy :-)
@SP-db6sh3 жыл бұрын
Upcoming : Price action based algo strategy in python ?
@Algovibes3 жыл бұрын
As always: Thanks a lot for your valuable suggestion, it really is a huge help :-) Will see what I can do but got some topics beforehand in the pipeline.
@boohoo7083 жыл бұрын
54 stocks in long and 54 Stocks in short is to much for a momentum strat… 10 stocks in long is enough….short you dont need… if you would calculate that, you would have much better results… 6 month ranking time is better then 12… skipping you dont need with 6 month holding time of 3 month would be better then 1 month thx for your perfect coding bro… cause this kind of strategies is usual not programmable with normal stockprogramms like tradingview…
@Algovibes3 жыл бұрын
Thanks for your comment and sharing your thoughts! :-) Really appreciate it!
@rraul3 жыл бұрын
Man, i Love you despite The 7x1... 😂
@Algovibes3 жыл бұрын
Thanks a lot for your nice comment :-) Love u2 :-* What do you mean with 7x1?
@rraul3 жыл бұрын
Germany 7x1 Brazil on Fifa world cup
@Algovibes3 жыл бұрын
@@rraul :D Apologies for that. But come on we didn‘t even reach the KO games last time. The 7:1 game wasn‘t representative in my highly uneducated soccer opinion.
@rraul3 жыл бұрын
@@Algovibes lol
@boohoo7083 жыл бұрын
what python version do you use?? hopefully python 3.9
@Algovibes3 жыл бұрын
Either 3.8 or 3.9. Not quite sure in that video. One of them but for the content of the video it shouldn't make any difference.
@srengodbersen14813 жыл бұрын
Great video! How can this model be so well documented when the contrary momentum strategy is also well documented? It seems a bit odd ;)
@Algovibes3 жыл бұрын
Thanks a a lot for your comment. Appreciate it! Maybe it's just too early but what do you mean with well documented?
@srengodbersen14813 жыл бұрын
@@Algovibes It just seem a bit to odd that two investing strategies that are direct opposite seem to work ;)
@Algovibes3 жыл бұрын
@@srengodbersen1481 ah got it now :-D Yes, but that's why the short term reversal effect is excluded in a momentum strategy.
@srengodbersen14813 жыл бұрын
@@Algovibes Thanks for your reply! That makes sence now, but still find it a bit odd :D
@kyle_bro3 жыл бұрын
Master of Pandas
@Algovibes3 жыл бұрын
🐼 Thanks for watching and your comment mate. I appreciate it :-)
@kyle_bro3 жыл бұрын
@@Algovibes No problem, great content! Really though how did you get so good at pandas lol
@Algovibes3 жыл бұрын
@@kyle_bro wrote my thesis mainly using pandas 🐼 for data manipulations, using pandas 🐼 nearly every day both privately and professionally. And I can tell I still have some painful experiences here and there :D
@Nightster3332 жыл бұрын
I don't understand the interest of this strategy because 0.018 < 0.613
@Algovibes2 жыл бұрын
Could you elaborate? Happy to discuss!
@Nightster3332 жыл бұрын
@@Algovibes if the return of the strategy is 0.018 and the buy and hold is 0.613 the strategy is worse than the buy and hold, unless I didn't catch something.
@johnsmith-qc8ud3 жыл бұрын
Hi! Great educational content! But i'm here to criticize your math a bit :) Why are you using mean() for average return? It simply gives wrong (too optimistic) results. Consider 2 months with returns -25% and +35%. Mean will result in +5%, but in fact you get sqrt(0.75*1.35) ~= +0.6% average. We get mistaken by an order in this example. You always need more % profit to compensate for negative return, thus the arithmetic mean of 1.8% may result even in negative overall profit in fact. Also the win ratio is only a half of the story when estimating the edge, another half is the average sizes of wins and losses. If they distributed unequally and average loss is greater that average win, you easily may end up with a losing strategy despite the higher than 50% win ratio. On the other hand there are profitable trending strategies with only 25-40% win ratio due to rare large wins.
@Algovibes3 жыл бұрын
Thanks a lot for watching and your kind words. Appreciate it! Also thanks a lot for sharing your thoughts. I am taking the mean return as I am assuming I am not entering with an (restricted) initial amount of capital but investing the same amount in the portfolio every month. You assume an initial amount of capital which will be shrinked on the first day and has to overcompensate the prior day. Don't get me wrong. I agree with your points but I just don't see it being false showing the average return. If you are following your assumption taking the cumulative return would be right: kzbin.info/www/bejne/nIirgqqniZifhLs BTW: Why are you taking the square root?
@johnsmith-qc8ud3 жыл бұрын
@@Algovibes yeah, the video you referenced is exacly about what i pointed out. The square root (in this case, or n-th root for averaging n values) comes from a definition of geometric average, the right way of averaging returns. It has exactly the same result if you use logreturns: exp(mean(ln(0.75), ln(1.35))) ~= 1.006 = +0.6%. Yes, you are right that you can ignore this if you can compensate for a loss after each negative period. The bad thing here is that it's like a hidden factor - you need some unpredictable amount of money to compensate each time after a negative period. This might be unfeasible if you invest for many years and the sum you adding each month is small comparing to the absolute variance of your investment. Thus it's better to use "compounding average" (not sure how to name it) which is geomean of returns.