If you like this video and want to support the channel: Buy Me a Drink: www.buymeacoffee.com/parttimelarry Also, I will be starting a spinoff channel on AI in music, art, and gaming in 2023. Subscribe at: youtube.com/@parttimeai Source Code: github.com/hackingthemarkets/walk-forward-optimization
Man you're a life savior; I was struggling understanding well how to do walk-forward optimization with vektorBT (indeed, the notebook in the doc isn't well commented), it is much clearer now. Greetings from France !
Cool! I have never heard of walk forward. But Ive implemented myself some kind of similar testing method. It's kind of similar to cross validation just for time series :) thanks for the video
Just a minor error. Probably worth mentioning though... future_data = vbt.AlpacaData.download('SPY', start='2021-06-01', timeframe='1d', limit=10000).get('Close') _APIError: your subscription does not permit querying data from the past 15 minutes_
Is there a reason that you only use a smaller "future" time period to confirm the results from the training period? It seems like we should be using at least a 200 bar period, if not a full 252.
Great but how do you write a real strategy?? Or use a real strategy function that takes a DF and returns ‘buy’. And then a real sell formula?? Is that a future video ?? Please :)
How can I do a walk-forward backtest without the optimization? I'd like to see how my strategy would have performed month on month if I had kept my parameters fixed.
Strange I can only install version 0.14.4 : λ pip install -U vectorbt==0.23.2 ERROR: Could not find a version that satisfies the requirement vectorbt==0.23.2 (from versions: 0.10, 0.11, 0.12, 0.13, 0.13.1, 0.13.2, 0.13.3, 0.13.4, 0.13.5, 0.13.6, 0.13.7, 0.14, 0.14.1, 0.14.2, 0.14.3, 0.14.4) ERROR: No matching distribution found for vectorbt==0.23.2
Are you using Python 3.7+? When I install a package I use pip3 in a Python 3.8 virtual environment. Some systems have pip for Python 2.7, just checking.
@@dservais1 I experienced the same issue as you. Vectorbt currently doesn't support python 3.10. Downgrading to python 3.9 resolved the issue, and vectorbt installed version 0.23.2.
@@emblazed2579 @Part Time Larry I had to downgrade from Python 3.10.2 to 3.8.10 to make it working. Thanks for the videos Larry, and thanks to Emblazed for the trick.
Super helpful content! Do you have other methodology of back testing to recommend? I have thought about changing the 70/30 to something like 60/40 or smaller or 60 to 20 with a skip in between. I'm trying to come up with other methods of back testing to see how well it will perform.
Hello Larry! Again, thanks for another great, clearly explained video. I was wondering if you could think of a way to have a single, continuous, optimised performance result, instead of individual metrics for every single optimised chunk (20 in this case). I was trying to look for the trade logs in vbt and override it with a concatenated version of it but I cannot seem to find the method to access them anymore.
Trying the same code on 1H data for 100 days for BTC. Takes 14GB of RAM to run.... For only 2 parameters to optimise. I can do the same in a C/C++ loop will take like 50 MB of RAM... Vector BT is over engineered, really.
I just measured peak memory usage of modeling 100 days of hourly price data for the code above (which yields 252 rows × 15600 columns btw) - 369.6 MB. Also note that vectorbt supports multiple modes, one of them allows you to run everything in Numba, just like in C/C++. If you run into memory issues feel free to post a GitHub issue and I'll take a look :)
I’m a follower and love your content and I appreciate your time. This video was difficult to stay with because you talk fast type fast and mouse is all over the screen. I came away with a near headache and frustration. To say the least.
hi larry. thanks for amazing works. you are great. also i didn't catch the last point of video. We found the best index of what ? i mean the point is to find those that give good results in real life among the data I tested. but you suddenly stopped. what did you find with "performance[performance.groupby('split_idx').idxmax()].index" ?? and what should i do next ? don't wory i am not going to take it as a financial advice :))
If you like this video and want to support the channel:
Buy Me a Drink: www.buymeacoffee.com/parttimelarry
Also, I will be starting a spinoff channel on AI in music, art, and gaming in 2023. Subscribe at: youtube.com/@parttimeai
Source Code: github.com/hackingthemarkets/walk-forward-optimization
You're the man! More VectorBT vids please.
Thanks larry.. Glad to see you back with excellent content .. This really helps in analysing my stategy settings.
Man you're a life savior; I was struggling understanding well how to do walk-forward optimization with vektorBT (indeed, the notebook in the doc isn't well commented), it is much clearer now. Greetings from France !
YES exactly what was needed Larry!
Please do more on VectorBT, specially optimization and TP/SL exits
Great video brother!
Cool! I have never heard of walk forward. But Ive implemented myself some kind of similar testing method. It's kind of similar to cross validation just for time series :) thanks for the video
Just a minor error. Probably worth mentioning though...
future_data = vbt.AlpacaData.download('SPY', start='2021-06-01', timeframe='1d', limit=10000).get('Close')
_APIError: your subscription does not permit querying data from the past 15 minutes_
Is there a reason that you only use a smaller "future" time period to confirm the results from the training period? It seems like we should be using at least a 200 bar period, if not a full 252.
WalkForwardOptimization implementation begins - 24:00
Do you have a guide for setting up VS Code?
train test split instead? Seems a bit squirrely
Hey Larry, wasn’t there another video of Vectorbt and Alpaca? Seems like it disappeared, can’t find it anymore …
Great but how do you write a real strategy?? Or use a real strategy function that takes a DF and returns ‘buy’. And then a real sell formula?? Is that a future video ?? Please :)
How can I do a walk-forward backtest without the optimization? I'd like to see how my strategy would have performed month on month if I had kept my parameters fixed.
In thos case you don't need to do walk forward. If you fix your parameters you just need to run your backtest once over the whole period.
Strange I can only install version 0.14.4 : λ pip install -U vectorbt==0.23.2
ERROR: Could not find a version that satisfies the requirement vectorbt==0.23.2 (from versions: 0.10, 0.11, 0.12, 0.13, 0.13.1, 0.13.2, 0.13.3, 0.13.4, 0.13.5, 0.13.6, 0.13.7, 0.14, 0.14.1, 0.14.2, 0.14.3, 0.14.4)
ERROR: No matching distribution found for vectorbt==0.23.2
Are you using Python 3.7+? When I install a package I use pip3 in a Python 3.8 virtual environment. Some systems have pip for Python 2.7, just checking.
@@parttimelarry I'm using 3.10.2 on windows 10.
@@dservais1 I experienced the same issue as you. Vectorbt currently doesn't support python 3.10. Downgrading to python 3.9 resolved the issue, and vectorbt installed version 0.23.2.
@@emblazed2579 @Part Time Larry I had to downgrade from Python 3.10.2 to 3.8.10 to make it working. Thanks for the videos Larry, and thanks to Emblazed for the trick.
@@emblazed2579 Thanks for helping out here!
Super helpful content! Do you have other methodology of back testing to recommend?
I have thought about changing the 70/30 to something like 60/40 or smaller or 60 to 20 with a skip in between.
I'm trying to come up with other methods of back testing to see how well it will perform.
Hello Larry! Again, thanks for another great, clearly explained video. I was wondering if you could think of a way to have a single, continuous, optimised performance result, instead of individual metrics for every single optimised chunk (20 in this case). I was trying to look for the trade logs in vbt and override it with a concatenated version of it but I cannot seem to find the method to access them anymore.
🔥🔥🔥🔥🔥❤️❤️
Trying the same code on 1H data for 100 days for BTC. Takes 14GB of RAM to run.... For only 2 parameters to optimise. I can do the same in a C/C++ loop will take like 50 MB of RAM...
Vector BT is over engineered, really.
Thanks for the comments!
@@parttimelarry but thanks for the video and explanations it is a very nice work you are doing ! :)
I just measured peak memory usage of modeling 100 days of hourly price data for the code above (which yields 252 rows × 15600 columns btw) - 369.6 MB. Also note that vectorbt supports multiple modes, one of them allows you to run everything in Numba, just like in C/C++. If you run into memory issues feel free to post a GitHub issue and I'll take a look :)
@@olegpolakow7286 thanks 👍. I am running on Jupiter notebook on Ubuntu, maybe that takes much more memory.
@@olegpolakow7286 Thanks so much for the library and the notebooks and for replying here.
Hello, larry your videos are very informative and easy to understand!😊♥️. please make a video on metatrader 5 expert advisor...
I’m a follower and love your content and I appreciate your time. This video was difficult to stay with because you talk fast type fast and mouse is all over the screen. I came away with a near headache and frustration. To say the least.
Thanks for the feedback
hi larry. thanks for amazing works. you are great. also i didn't catch the last point of video. We found the best index of what ? i mean the point is to find those that give good results in real life among the data I tested. but you suddenly stopped. what did you find with "performance[performance.groupby('split_idx').idxmax()].index" ?? and what should i do next ? don't wory i am not going to take it as a financial advice :))