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 calculate the highest close value in a period except current close value?
-
Now I use this method:
# include current close value btind.Highest(self.data.close, period=n) # except current close value btind.Highest(self.data.close(-1), period=n-1)
Is there a better method?
-
@g_will said in How to calculate the highest close value in a period except current close value?:
# except current close value btind.Highest(self.data.close(-1), period=n-1)
close(-1)
excludes the current close from the calculation, so it would seem to fit your purpose perfectly. Whether you usen
orn - 1
is really up to your expectation of how many data points have to be included.