Probably one of the most practical algotrading/backtesting content on the Web. Most of which is just pure water.
@Algovibes Жыл бұрын
Thanks a lot mate! Be kindly invited to check out my other stuff.
@pethiraj Жыл бұрын
Excellent information and this is the only video on YT with clear method on how to optimize and validate our strategy. Thanks for taking time and sharing your knowledge. Greatly Appreciated and it benefited a lot! Thanks!
@Algovibes Жыл бұрын
Thank you very much!
@gianfrancosilvestri2155 Жыл бұрын
Incredible Algovibes! Never met so clear explantions and so concise code in the same tutorial!!
@Algovibes Жыл бұрын
Very happy to read! Thanks a lot for watching and leaving a comment :-)
@ageens Жыл бұрын
this is so much fun to find combinations of SMAs which doe not make much sense but works very well.
@fudgenuggets405 Жыл бұрын
This is top notch stuff. Although the total profit of the strategy may not beat buy and hold, the advantage is you are not in the position full time. When you are out of the position, your capital could be invested in another asset if it is in a state that expects to outperform AAPL at that particular time... or you could stay in cash and sleep easier at night.
@Algovibes Жыл бұрын
Agreed! Be invited to check out my newest series. I am going more into details there.
@cooltraderf Жыл бұрын
This is really great. Very clean and concise code. Well done.
@Algovibes Жыл бұрын
Thanks buddy! Be invited to check out my other stuff :-)
@k2icc Жыл бұрын
Great. It will be nice to expand as stated. Thanks.
@Algovibes Жыл бұрын
Thanks for your feedback, highly appreciated!
@denniscarver9147 Жыл бұрын
I'd love to see more of these.
@Algovibes Жыл бұрын
Thx for your feedback Dennis! Appreciate it.
@JenniferGan-q3k Жыл бұрын
Hi Dennis Carver, I can guide you how to invest in cryptocurrency. So you can leave me your contact. Regards
@Master_of_Chess_Shorts Жыл бұрын
very nice approach and great explanation of multiple fundamental concepts. you keep producing interesting content, thanks
@Algovibes Жыл бұрын
Thanks a lot mate. Appreciate your comment!
@gianpaoloborrello Жыл бұрын
you can optimise if you filter where SMA_1 and SMA_2 have inverted values. ex. SMA_1=10 and SMA_2=15 vs SMA_1=15 and SMA_2=10
@ageens Жыл бұрын
ahh, I just threw away all values where sma_1 > sma_2
@bryan-9742 Жыл бұрын
very interesting!
@Algovibes Жыл бұрын
Thanks for your feedback Bryan!
@muggzzzzz Жыл бұрын
Once upon a time I was testing my grid trading strategy, and I got my balance to be 100x as much as initial balance in a matter of one year. But if I move the starting point of a testing literally by one day, i got busted almost immediately. So you shouldn't be obsessed with optimization. It should be able to keep being on the flow no matter of the 'financial weather'.
@vetiarvind Жыл бұрын
Good point, overfitting isn't a good idea always.
@Algovibes Жыл бұрын
Referring to that at the end of the video. For a bulletproof optimization you need a train test split. I have covered something very similar here: kzbin.info/www/bejne/o5LFdHyoYsZnfqM
@muggzzzzz Жыл бұрын
@@Algovibes I'm sorry for commenting before watching the full video.
@Niko-ie6dh Жыл бұрын
does the cross join and then loop over the dataframe way have a performance benefit over the nested loop? Intuitively I would have iterated just over x and y in a nested for loop
@vladvol855 Жыл бұрын
What is the probabilty that optimized parametrs will bring profite in the future trading? The probability is very low, because you a looking for a best parametr using past data, but not checking, how this parametrs works on the future data! It is much more interesting to listen about forward testing, not about backtesting!
@Algovibes Жыл бұрын
You repeated exactly what I said in the video. I have content on that as well - Just watch all my videos and you will get a detailed and holistic view. Let me know if you need anything!
@fudgenuggets405 Жыл бұрын
If you have access to the "future data" then you don't need a trading strategy. Unfortunately google doesn't provide any links to future stock prices.
@eliotharreau762710 ай бұрын
Hi, how to make the same cartesien product with tree paramaters x y z , because the merge function only accept two parameters ? Thank you
@Leonhard-Euler Жыл бұрын
One point: You should check the period for sma_1 is less than that for sma_2
@Algovibes Жыл бұрын
Not necessarily as I wanted to test both sides but definitely an option.
@kobiyobi6295 ай бұрын
Could you explain how to use tensor flow to use GPU power when you have many more parameters
@eugenelee9826 Жыл бұрын
Would a nested for loop work the same way as the cartesian product method, in the case of optimizing for 2 parameters?
@Algovibes Жыл бұрын
Also possible to solve this with a Nested loop but I highly recommend using the cartesian product/cross join here.
@MohkKh Жыл бұрын
Thanks Bro, How to detect support and resistance using python?
@Algovibes Жыл бұрын
Interesting topic. Thanks for the suggestion!
@MohkKh Жыл бұрын
@@Algovibes Thanks for reply. Please make the code as simple as you can😇
@sweealamak628 Жыл бұрын
From a coding perspective, have you ever tried list comprehension for the conditional looping logic? I'm taking an online python course and they suggest "pythonic" way of coding. Their recommendation is centered around dealing with very large datasets. Just wondering whether you think there's a material benefit switching styles for this specific case of trading labels.
@Algovibes Жыл бұрын
Wouldn't make sense here at all. But yes I am a big time user of list comprehensions :-)
@sweealamak628 Жыл бұрын
@@Algovibes Thanks for replying. Will keep a look out for instances where you use list comprehension. 👍 Lots to learn 🫡
@mnmedipa9239 Жыл бұрын
Could we please have a video about support and resistance level detection in python for bitcoin?
@Algovibes Жыл бұрын
Cool suggestion! Thanks a lot
@bigphab7205 Жыл бұрын
Does it need to outperform the underlying vehicle to be viable?
@Algovibes Жыл бұрын
No definitely not. I am just referring to the interesting result that no matter which values you are passing you never outperform the asset itself over the long term (at least Apple). Interestingly this is not true for assets with a rather bad performance (e.g. MMM). There is much more to be considered: Exposure Time, Volatility, Max Drawdown, turnover and trading costs.
@bigphab7205 Жыл бұрын
@@Algovibes just curious. Cuz I always hear people talking about whether it does or doesn't. Drawdown is another term that lacks intuitive-ness for me too. Thanks.
@Master_of_Chess_Shorts Жыл бұрын
@@Algovibes would be fun to use volume as an indicator to determine how likely your trade would go through. For Apple it might not be an issue but this is another dimension of a full optimisation strategy.
@fudgenuggets405 Жыл бұрын
@@Algovibes this type of strategy should work much better for cyclical stocks like energy companies.
@fudgenuggets405 Жыл бұрын
I took algovibes' code and did a quick test on XOM to test this idea. To save time I only examined sma's from 10 to 50. Buy and hold had profit of 1.664 and the sma strategy produced a profit of 2.180 so it can (not necessarily will) work better on cyclical stocks.
@ageens Жыл бұрын
don't take AAPL, bet something wavy instead, like efs - TLT, HYG, JNK. SPY is not "wavy" but still a tiny bit outperform "buy and hold". Need something volatile but horizontal to outperform growing monsters.
@ageens Жыл бұрын
poor GDX goes like chupa-chups. I do not see sense for n > 75-100 (edit: well 100... )
@Algovibes Жыл бұрын
@@ageens 😄
@fudgenuggets405 Жыл бұрын
Energy stocks are perfect for this type of strategy.
@yusufilkerozturk4715 Жыл бұрын
try vectorbt
@ko-prometheus Жыл бұрын
☢☢☢☢☢
@Algovibes Жыл бұрын
Thx for watching Konstantin! :)
@blasdelezo8396 Жыл бұрын
Its better to use final = final[final.sma_1 < final.sma_2]