CTA策略,log打印出来了,委托记录那里也显示的全部成交,结果下个bar走到这里还是-1,然后又cover和buy了一次
if m[-1]>m[-2]:
print("pos: ",self.pos)
if self.pos == 0:
self.buy(bar.close_price, 1)
print("%s buy"%(bar.datetime))
elif self.pos <0:
print("cover and buy")
self.cover(bar.close_price,1)
self.buy(bar.close_price,1)