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

Поделиться
HTML-код
  • Опубликовано: 25 окт 2024

Комментарии • 41

  • @anilmm2005
    @anilmm2005 3 месяца назад +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 3 месяца назад +2

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

    • @Algovibes
      @Algovibes  3 месяца назад

      thanks mate, delighted to read that :-)

  • @traderjoe54
    @traderjoe54 3 месяца назад +2

    love your work, thanks

    • @Algovibes
      @Algovibes  3 месяца назад

      Love having you on board! thanks mate

  • @tr0wb3d3r5
    @tr0wb3d3r5 3 месяца назад +2

    The 🐐, ty a ton for the teachings💖

    • @Algovibes
      @Algovibes  3 месяца назад

      Thank you mate, nice comment 😆

  • @Arivan_Abdulla
    @Arivan_Abdulla 3 месяца назад +2

    Thanks so much for the video man Very helpful

    • @Algovibes
      @Algovibes  3 месяца назад

      happy to read! Thx :-)

  • @saxegothaea_conspicua
    @saxegothaea_conspicua 3 месяца назад +2

    amazing video!!

    • @Algovibes
      @Algovibes  3 месяца назад

      @@saxegothaea_conspicua thank you mate

  • @andreoproprio
    @andreoproprio 3 месяца назад +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  3 месяца назад

      yessir! Also mentioning that in the vid btw

  • @TycoonCapitall
    @TycoonCapitall 3 месяца назад +2

    Hopefully we get a cross-sectional momentum strat tutorial!

    • @Algovibes
      @Algovibes  3 месяца назад

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

  • @javierloa9197
    @javierloa9197 2 месяца назад +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 ?

  • @ED-iz1bf
    @ED-iz1bf 8 дней назад +1

    this technique can apply for crypto market?

    • @Algovibes
      @Algovibes  8 дней назад

      sure, go ahead! Let me know your insights

    • @ED-iz1bf
      @ED-iz1bf 8 дней назад

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

  • @froggoman4756
    @froggoman4756 3 месяца назад

    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 3 месяца назад

      Adj Close adjusts for dividends/splits etc.

    • @froggoman4756
      @froggoman4756 3 месяца назад

      @@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 3 месяца назад

      @@froggoman4756 ah, my bad.

    • @Algovibes
      @Algovibes  3 месяца назад +1

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

  • @jean-francoislebroch9171
    @jean-francoislebroch9171 3 месяца назад +1

    Great

  • @factoryofgaming5229
    @factoryofgaming5229 3 месяца назад

    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  3 месяца назад +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.

  • @int2str
    @int2str 3 месяца назад +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 3 месяца назад

      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 3 месяца назад +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 3 месяца назад

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

    • @Algovibes
      @Algovibes  3 месяца назад

      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 3 месяца назад +1

    ❤❤❤😊

  • @deekshitpatel4647
    @deekshitpatel4647 3 месяца назад +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  3 месяца назад

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