For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Lowest close of n bars throws error
-
I am trying to find out if current bar close is lowest of say previous 15 bars and below is my code :
self.dataclose[0] == self.dataclose[-15:].min()
But I am getting following error:TypeError: unsupported operand type(s) for +: 'int' and 'slice' -
Slicing is not directly supported for lines objects.
Take a look at the following docs: https://backtrader.com/docu/concepts/#slicing
-
Thanks for reply! Link was useful and I could solve my problem.