Backtesting SPY with Gaussian Mixture Model Regime Detection - Issue Found (See Next Video)

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ • 29

  • @jb_makesgames2264
    @jb_makesgames2264 2 роки тому +5

    Great Video - your results seem truly amazing. I would however exercise caution as the results seem almost too good to be true and should be able to be replicated by other people in other markets before being adopted. Your channel is one of the most unique on UA-cam.

  • @Asparuh.Emilov
    @Asparuh.Emilov 2 роки тому +3

    Thank you for sharing this valuable information! I really appreciate it, it’s really exciting me since I was searching already how to predict market state. One thing to be mindful of, would be, that you trained the model on the entire data and bqsicalky you already know all the states in anticipation of the strategy entries or at least that's how I understood it. Wouldn't be more realistic to try to determine the states with one part of the data then try to see if you will be able to recognize those states for unseen data applying the trading srrategy?

  • @doncalpe
    @doncalpe 2 роки тому +5

    I wonder if you forgot to shift the signals for one day. It looks suspiciously so. I have seen this over and over again - and I have made this mistake myself in the past.It is sometimes unbelievable what a difference one day makes.

    • @CryptoWizards
      @CryptoWizards  2 роки тому

      100% spot on! When I changed the close to be the following days open in terms of assumed strategy returns, plus lagged the HMM by 1 day - I got dramatically worse results. However, if not lagging the HMM by 1 day - still extremely favourable results.
      More testing is needed and back to the drawing board lol.

  • @Alexrmacleod
    @Alexrmacleod Рік тому

    Did you finish the AI parts of your course your were talking about i am thinking of taking it.

  • @xaknafein
    @xaknafein 2 роки тому +2

    Haven't gone through the notebook but if you're calculating signals (even partially) on Close, you are ensuring the trade takes place on next Open right?

    • @xaknafein
      @xaknafein 2 роки тому

      Also after doing "run all" I can't reproduce results. I get negative sharpe. I wonder if you're hardcoding something that is randomized? Labels perhaps?

    • @CryptoWizards
      @CryptoWizards  2 роки тому +3

      Thanks Xaknafein. Am equally hunting for this. Having now changed the close to the Open, I definitely see a big drop - but still a really strong Sharpe.
      Returns Benchmark: 101.56%
      Returns Regime Strategy with MA Cross: 85.08%
      The returns are indeed lower, but the Sharpe is still looking strong:
      Sharpe Ratio Benchmark: 0.848
      Sharpe Ratio Regime Strategy with MA Cross: 3.275
      When adjusting for the HMM (Not GMM), am getting ridiculous results:
      Sharpe Ratio Benchmark: 0.817
      Sharpe Ratio Regime Strategy with MA Cross: 5.426
      --- ---
      Returns Benchmark: 96.35%
      Returns Regime Strategy with MA Cross: 213.36%
      HOWEVER...if I lag the HMM by one day, I get much, much worse performance. So you are right...one day can make ALL the difference. Thanks a lot for the healthy dose of realism. Back to the drawing board.

    • @xaknafein
      @xaknafein 2 роки тому

      @@CryptoWizards Keep at it 👍

    • @xaknafein
      @xaknafein 2 роки тому

      @@CryptoWizards another possible issue is that through various kernel restarts, your regime labels don't stay constant. In 1 run, label 0 corresponds to a bull regime but in the next kernel restart it's the bearish regime. This can be trivially broken down in an extra step to keep the results constant though all executions.

    • @CryptoWizards
      @CryptoWizards  2 роки тому

      Great insight! I think you're right, need to initialise these things with a consistent random seed or something. Working on HMM's more and going to find other ways of quantifying their use given that Backtesting can only get you so far - more ML and tests needed.

  • @robinkoger5717
    @robinkoger5717 2 роки тому

    Great insides thank you! Are you going to sell a script which implements the different states on a normal chart?

  • @OneCreator87
    @OneCreator87 Рік тому

    So it's basically a regime filter, I don't understand how it works sadly, or how it is different from a common filter/indicator.

  • @jacquesdurand4416
    @jacquesdurand4416 Рік тому

    Really awesome video ! Definitely look into "K-Fold Testing" The market 500 days ago is not the same as the last 100. I have a similar project (but uses a very different approach )

    • @CryptoWizards
      @CryptoWizards  Рік тому +1

      5 years of YT and I still haven't worked out how to pin comments to the top. This is a good one.

    • @jacquesdurand4416
      @jacquesdurand4416 Рік тому

      @@CryptoWizards We all are getting old that's why :P

  • @getYourNetCH
    @getYourNetCH 11 місяців тому +1

    Of course you have a bias in it. It's the strong uptrending market and the assumption it will continue. Test it with a ranging market or distort the data to eliminate the trend and you will see the true result of your system. If you want to trust and trade a uptrend bias, you can simply buy the the tops with proper risk and money management, no machine learning needed.

  • @alexeygrom1834
    @alexeygrom1834 2 роки тому +3

    jeezus holy fuck that was awesome !
    when favor for 0 states only iv got:
    Sharpe Ratio Benchmark: 0.513
    Sharpe Ratio Regime Strategy with MA Cross: 5.418
    --- ---
    Returns Benchmark: 48.17%
    Returns Regime Strategy with MA Cross: 213.36%

    • @CryptoWizards
      @CryptoWizards  2 роки тому +1

      Wowzers! Great you checked out the code! Yeah, it seems crazy. Im running some supervised ML against this to see. But yeah. It's unreal!

  • @marksukhinin7622
    @marksukhinin7622 2 роки тому +2

    Applying this to crypto would be kind of silly, but still interesting to see)

    • @CryptoWizards
      @CryptoWizards  2 роки тому

      Lol! It's always an adventure with Crypto.

    • @jnprz9799
      @jnprz9799 2 роки тому

      Why silly? Bitcoin basically acts like a tech stock nowadays

    • @marksukhinin7622
      @marksukhinin7622 2 роки тому

      @@jnprz9799 You may be right. But honestly I have no idea how it is in comparison to stocks. Arguably bitcoin is not a crypto anymore (imo) so... Ideas become strategies with backtests or they don't)

  • @leonyeh
    @leonyeh 2 роки тому +1

    What a great discovery

  • @sbqb21
    @sbqb21 4 місяці тому

    thank you ❤