Step-by-Step Guide: Time Series Momentum Trading with Python

Поділитися
Вставка
  • Опубліковано 15 лис 2024

КОМЕНТАРІ •

  • @anilmm2005
    @anilmm2005 4 місяці тому +5

    This was long time coming and an extremely important topic. Looking forward to the follow-up video for providing more guidance on it. Thank you.

  • @mayankjain24in
    @mayankjain24in 4 місяці тому +2

    always learn something new from you .... your approach towards solution is very precise..

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

      thanks mate, delighted to read that :-)

  • @TycoonCapitall
    @TycoonCapitall 4 місяці тому +2

    Hopefully we get a cross-sectional momentum strat tutorial!

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

      There already is a couple of them :-) Be invited to explore the Python for Finance playlist!

  • @Arivan_Abdulla
    @Arivan_Abdulla 4 місяці тому +2

    Thanks so much for the video man Very helpful

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

      happy to read! Thx :-)

  • @tr0wb3d3r5
    @tr0wb3d3r5 4 місяці тому +2

    The 🐐, ty a ton for the teachings💖

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

      Thank you mate, nice comment 😆

  • @andreoproprio
    @andreoproprio 4 місяці тому +2

    For illustration purposes it's fine to use the Close, but bear in mind in real life you must use Adj Close, as the price series for the Close are distorted caused by dividends and splits.

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

      yessir! Also mentioning that in the vid btw

  • @traderjoe54
    @traderjoe54 4 місяці тому +2

    love your work, thanks

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

      Love having you on board! thanks mate

  • @saxegothaea_conspicua
    @saxegothaea_conspicua 3 місяці тому +2

    amazing video!!

    • @Algovibes
      @Algovibes  3 місяці тому

      @@saxegothaea_conspicua thank you mate

  • @javierloa9197
    @javierloa9197 3 місяці тому +1

    When is the factoring video coming out?

    • @Algovibes
      @Algovibes  2 місяці тому

      Have too see, video is on the edge of becoming worth it. Will see what I can do!

  • @Irizu_
    @Irizu_ Місяць тому +1

    i'm a beginner with all of this but it is possible to implement this strategy with your binance bot ?

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

    Could you expand on the main reason/difference between using Close and Adj Close? I'm curious as to how/why it changes how you calculate the Open? (in general I always used Adj Close but now I'm questioning in which situations I should use it and when I shouldn't)

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

      Adj Close adjusts for dividends/splits etc.

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

      @@andreasklippinge9665 thanks, I'm aware of what it "is", but my initial question remains. How does it change what you need to do for the Open? (as mentioned in the video only briefly)

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

      @@froggoman4756 ah, my bad.

    • @Algovibes
      @Algovibes  4 місяці тому +1

      Hi :-) You just need to adjust the Open by the same factor you adjusted the Close for.

  • @ED-iz1bf
    @ED-iz1bf 29 днів тому +1

    this technique can apply for crypto market?

    • @Algovibes
      @Algovibes  29 днів тому

      sure, go ahead! Let me know your insights

    • @ED-iz1bf
      @ED-iz1bf 29 днів тому

      @@Algovibes I’m struggling when should we use momentum or mean reversion on the market

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

    I wrote my thesis in momentum trading strategies. I think this is an misrepresentation of the concept. Momentum in this form relies on a portfolio of stocks rather than a single asset, both long and short, making it self financing. This is open to broad market risk. Also, you conveniently pick a stock that we all know went up significantly over the backrest period. It would be nice to see this on a portfolio of say 20 equities, as by then you diversify much of the market risk away. Still, great video, but needs more depth.
    Edit: I was talking about cross sectional momentum. Apologies!

    • @Algovibes
      @Algovibes  4 місяці тому +1

      As you mentioned: Different story but I have great news for you - I covered cross-sectional momentum on my 9 hour Python for Finance course :-)
      If you need a free option its also covered in the Python for Finance playlist.

  • @jean-francoislebroch9171
    @jean-francoislebroch9171 4 місяці тому +1

    Great

  • @int2str
    @int2str 4 місяці тому +1

    Not a python expert here, but I feel like there's a bug in the logic. If you're setting "in_position" to True, and then immediately calculate the profit and set in_position back to false, you will "buy" on consecutive days, which presumably is not realistic/desired.
    But again, not a Python expert here....

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

      The bot should buy only when in_position = False, so after buy in_position will be True and will hold True for 5 days.

    • @int2str
      @int2str 4 місяці тому +1

      @@jalexisg Incorrect. The "if not in_position" sets "in_position" to True and then the next "if in_position" sets it right back to false. That's the bug.

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

      @@int2str Yes, it's a bug. I meant it "should" buy only if in_position = False.

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

      Doesn't have an impact, anyhow here you go:
      profits = []
      in_position = False
      sellidx = pd.to_datetime('1900-01-01')
      buyprice = None # Initialize buyprice outside the loop
      for index, row in df.iterrows():
      if not in_position and row.signal and index > sellidx:
      buyprice = row.buyprice
      in_position = True
      elif in_position:
      sellprice = row.Close # Assume the current row's Close price is used for selling
      sellidx = index
      profit = (sellprice - buyprice) / buyprice
      profits.append(profit)
      in_position = False

  • @its_code
    @its_code 4 місяці тому +1

    ❤❤❤😊

  • @deekshitpatel4647
    @deekshitpatel4647 4 місяці тому +1

    Sir great knowledge gained from you i have learnt a lot from you
    @algovibes
    Can you please make a video on Renko Trading Strategy backtest?

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

      Happy to read man! Thanks a lot for the suggestion, will see what I can do.