The truth value of an array with more than one element is ambiguous.Use a.any() or a.all()
MID1 = talib.MA(am.close, timeperiod = 20, matype=0)
TMP1 = talib.STDDEV(am.close, timeperiod = 20, nbdev=1)
TOP1 = MID1 + 2 * TMP1
BOTTOM1 = MID1 - 2 * TMP1
if self.pos == 0:
if am.close > TOP1:-----------这里抛出异常
self.buy(bar.close_price, fixed_size, True)
先行谢过。