For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
How to get max close price for the past n days
-
How to get the maximum close price for the past n days? I tried to use Max indicator but it is not supported?
clsmax = bt.ind.Max(data.close, period=self.p.nmax)
TypeError: init() got an unexpected keyword argument 'period' -
bt.ind.Max
is equivalent to python'smax
. You can apply it to several data feeds/indicators (and combinations of boths)You are looking for
MaxN
/Highest
. TheN
is there to indicate that a period is involved. -
I see. Thank you!