For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
NameError: name 'buy_signal' is not defined
-
NameError: name 'buy_signal' is not defined
Get this error:
NameError: name 'buy_signal' is not defined
even though I have defined 'buy_signal' indef __init__(self):
def __init__(self): buy_signal = bt.If(A < float('Inf'), c(0) > B, False) sell_signal = bt.If(C < float('Inf'), c(0) < D, False) def next(self): if buy_signal[0]: self.buy() elif sell_signal[0] and self.position > 0: self.close()
Thanks.
-