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
-
Teddy Koker asked for comments on the usage of backtrader in the very fine post about a Momentum Strategy
A link to the original is included.
-
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!
-
@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.
-
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/