For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Limit order with a day valid never gets executed? #220



  • Thanks for the detail explanation, after I set cash value, it works perfectly. Thanks again.



  • 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)
    

    '''


Log in to reply
 

});