Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Cookbook - Momentum Strategy - Comments

    Blog
    4
    4
    1431
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      backtrader administrators last edited by backtrader

      Teddy Koker asked for comments on the usage of backtrader in the very fine post about a Momentum Strategy

      • https://cookbook.backtrader.com/recipes/articles/2019-05-20-momentum-strategy/momentum-strategy/

      A link to the original is included.

      1 Reply Last reply Reply Quote 2
      • Eduardo De La Garza
        Eduardo De La Garza last edited by

        Is it possible that there are some errors in the code? For example, in:

        self.inds[d]['mom'] = self.p.momentum(d, period=self.momentum_period)
        

        shouldn't it be

        self.inds[d]['mom'] = self.p.momentum(d, period=self.p.momentum_period)
        

        I just want to make sure I'm not making a mistake. Thanks!

        1 Reply Last reply Reply Quote 0
        • run-out
          run-out last edited by

          @Eduardo-De-La-Garza said in Cookbook - Momentum Strategy - Comments:

          self.inds[d]['mom'] = self.

          Looks like a typo. I think you have it right.

          1 Reply Last reply Reply Quote 1
          • vladisld
            vladisld last edited by

            It seems the link in the original topic is no longer valid. Here is the updated link: https://www.backtrader.com/blog/2019-05-20-momentum-strategy/momentum-strategy/

            1 Reply Last reply Reply Quote 4
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
            $(document).ready(function () { app.coldLoad(); }); }