build/strategies.py
def notify_order(self, order):
        """
        Checks if an order is completed, before logging it to the console. Can 
        reject the order if the money is not enough. Resets order the end.

        Arguments:
            order {Order} -- current buy/sell/close order 
        """
        if order.status in [order.Submitted, order.Accepted]:
            # An active Buy/Sell order has been submitted/accepted - Nothing to do
            return

        # Check if an order has been completed
        # Attention: broker could reject order if not enough cash
        if order.status in [order.Completed]:
            if order.isbuy():
                self.log(f'BUY EXECUTED, {order.executed.price:.2f}')
            elif order.issell():
                self.log(f'SELL EXECUTED, {order.executed.price:.2f}')
            self.bar_executed = len(self)

        elif order.status in [order.Canceled, order.Margin, order.Rejected]:
            self.log('Order Canceled/Margin/Rejected')

        # Reset orders
        self.order = None

        Checks if an order is completed, before logging it to the console. Can 
        reject the order if the money is not enough. Resets order the end.

        Arguments:
            order {Order} -- current buy/sell/close order 
        
Checks if an order is completed, before logging it to the console. Can
reject the order if the money is not enough. Resets order the end.

order {Order} -- current buy/sell/close order
Checks if an order is completed before logging it to the console . Can reject the order if the money is not enough . Resets order the end . order { Order } -- current buy / sell / close order
def notify_order(self, order):
        if order.status in [order.Submitted, order.Accepted]:
            return
        if order.status in [order.Completed]:
            if order.isbuy():
                self.log(f'BUY EXECUTED, {order.executed.price:.2f}')
            elif order.issell():
                self.log(f'SELL EXECUTED, {order.executed.price:.2f}')
            self.bar_executed = len(self)
        elif order.status in [order.Canceled, order.Margin, order.Rejected]:
            self.log('Order Canceled/Margin/Rejected')
        self.order = None
def notify_order ( self , order ) : if order . status in [ order . Submitted , order . Accepted ] : return if order . status in [ order . Completed ] : if order . isbuy ( ) : self . log ( f'BUY EXECUTED, {order.executed.price:.2f}' ) elif order . issell ( ) : self . log ( f'SELL EXECUTED, {order.executed.price:.2f}' ) self . bar_executed = len ( self ) elif order . status in [ order . Canceled , order . Margin , order . Rejected ] : self . log ( 'Order Canceled/Margin/Rejected' ) self . order = None
Checks if an order is completed, before logging it to the console.
Checks if an order is completed before logging it to the console .
"""
        Checks if an order is completed, before logging it to the console. Can 
        reject the order if the money is not enough. Resets order the end.

        Arguments:
            order {Order} -- current buy/sell/close order 
        """ # An active Buy/Sell order has been submitted/accepted - Nothing to do # Check if an order has been completed # Attention: broker could reject order if not enough cash # Reset orders
self
order