Limit order with a day valid never gets executed? #220
ypyean last edited by
Thanks for the detail explanation, after I set cash value, it works perfectly. Thanks again.
Batman last edited by
I had a similar problem and resolved by canceling the pending order every and then recreating it. This way there's no "weekend problem" when the order for next day is more than one day ahead.
def next(self): self.cancel(self.order) ... if not self.position: self.order = self.buy(price = buy_price, exectype = bt.Order.Limit) else: self.order = self.close(price = sell_price, exectype = bt.Order.Limit)