In a stratey's init method, I write:
testIndicator = bt.If(self.data0.close==0, 10, 1/self.data0.close)
Then, it gives "ZeroDivisionError: float division by zero". It seems bt.If doesn't protect float division by zero. Any idea?
@Li-Mike said in bt.If( ) doesn't protect float division by zero.:
Community > Search "divizion by zero"
My fault. Thank you.