Walk Forward Optimization with VectorBT and Alpaca

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ม.ค. 2025

ความคิดเห็น •

  • @parttimelarry
    @parttimelarry  2 ปีที่แล้ว

    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

  • @lucidwavs4004
    @lucidwavs4004 2 ปีที่แล้ว +6

    You're the man! More VectorBT vids please.

  • @prabhu_patil
    @prabhu_patil 2 ปีที่แล้ว +3

    Thanks larry.. Glad to see you back with excellent content .. This really helps in analysing my stategy settings.

  • @izem9652
    @izem9652 2 ปีที่แล้ว +2

    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 !

  • @somajuice666
    @somajuice666 2 ปีที่แล้ว +2

    YES exactly what was needed Larry!

  • @ashkanhesaraki
    @ashkanhesaraki ปีที่แล้ว +2

    Please do more on VectorBT, specially optimization and TP/SL exits

  • @juanpablorocha5609
    @juanpablorocha5609 ปีที่แล้ว

    Great video brother!

  • @Userjdanon
    @Userjdanon 2 ปีที่แล้ว +1

    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

  • @J2897Tutorials
    @J2897Tutorials 2 ปีที่แล้ว +3

    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_

  • @neuvocastezero1838
    @neuvocastezero1838 2 หลายเดือนก่อน

    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.

  • @kevinalexis9886
    @kevinalexis9886 9 หลายเดือนก่อน

    WalkForwardOptimization implementation begins - 24:00

  • @robertcraig24
    @robertcraig24 ปีที่แล้ว

    Do you have a guide for setting up VS Code?

  • @turnbull82
    @turnbull82 ปีที่แล้ว

    train test split instead? Seems a bit squirrely

  • @petrzurek5713
    @petrzurek5713 2 ปีที่แล้ว

    Hey Larry, wasn’t there another video of Vectorbt and Alpaca? Seems like it disappeared, can’t find it anymore …

  • @brianrowe1152
    @brianrowe1152 2 ปีที่แล้ว

    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 :)

  • @lorenzourera4223
    @lorenzourera4223 2 ปีที่แล้ว

    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.

    • @brandonjohnson8880
      @brandonjohnson8880 ปีที่แล้ว +1

      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.

  • @dservais1
    @dservais1 2 ปีที่แล้ว +1

    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

    • @parttimelarry
      @parttimelarry  2 ปีที่แล้ว +1

      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
      @dservais1 2 ปีที่แล้ว

      @@parttimelarry I'm using 3.10.2 on windows 10.

    • @emblazed2579
      @emblazed2579 2 ปีที่แล้ว +4

      ​@@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.

    • @dservais1
      @dservais1 2 ปีที่แล้ว +3

      @@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.

    • @parttimelarry
      @parttimelarry  2 ปีที่แล้ว +1

      @@emblazed2579 Thanks for helping out here!

  • @GusMagalhaes
    @GusMagalhaes 2 ปีที่แล้ว

    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.

  • @theus_mago
    @theus_mago 2 ปีที่แล้ว

    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.

  • @carters6138
    @carters6138 2 ปีที่แล้ว

    🔥🔥🔥🔥🔥❤️❤️

  • @DavidDji_1989
    @DavidDji_1989 2 ปีที่แล้ว +1

    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.

    • @parttimelarry
      @parttimelarry  2 ปีที่แล้ว

      Thanks for the comments!

    • @DavidDji_1989
      @DavidDji_1989 2 ปีที่แล้ว +1

      @@parttimelarry but thanks for the video and explanations it is a very nice work you are doing ! :)

    • @olegpolakow7286
      @olegpolakow7286 2 ปีที่แล้ว +7

      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 :)

    • @DavidDji_1989
      @DavidDji_1989 2 ปีที่แล้ว

      @@olegpolakow7286 thanks 👍. I am running on Jupiter notebook on Ubuntu, maybe that takes much more memory.

    • @parttimelarry
      @parttimelarry  2 ปีที่แล้ว +5

      @@olegpolakow7286 Thanks so much for the library and the notebooks and for replying here.

  • @urgebharadwaj9081
    @urgebharadwaj9081 2 ปีที่แล้ว +1

    Hello, larry your videos are very informative and easy to understand!😊♥️. please make a video on metatrader 5 expert advisor...

  • @letsgobrandon2044
    @letsgobrandon2044 2 ปีที่แล้ว

    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.

  • @gokhanfidan4636
    @gokhanfidan4636 2 ปีที่แล้ว

    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 :))