self.levels=[1419.73, 1397.81032, 1384.24984, 1373.29, 1362.33016, 1346.72632, 1326.85]
if self.levels is not None:
for level in self.levels.values():
if level is not None and level not in self.used_levels:
self.buy_price = level
print(self.buy_price)
self.buy(Decimal(self.buy_price), Decimal(0.2 * self.fixed_size), stop=True)
self.used_levels.append(level)
这段代码中,回测时,停止单的价格低于当前价格时会立即成交。要如何实现当前价格跌到指定价格的时候才买入。