def bookkeep(self, trade, order, verbose):

                outstr = '%s (%s) bookkeeping: orders=' % (self.tid, self.ttype)
                for order in self.orders: outstr = outstr + str(order)

                self.blotter.append(trade)  # add trade record to trader's blotter
                # NB What follows is **LAZY** -- assumes all orders are quantity=1
                transactionprice = trade['price']
                if self.orders[0].otype == 'Bid':
                        profit = self.orders[0].price - transactionprice
                else:
                        profit = self.orders[0].price - transactionprice
                self.balance += profit
                if verbose: print('%s profit=%d balance=%d ' % (outstr, profit, self.balance))
                self.del_order(order)  # delete the order


        # specify how trader responds to events in the market
        # this is a null action, expect it to be overloaded with clever things by specific algos
dataset/ETHPy150Open davecliff/BristolStockExchange/BSE.py/Trader.bookkeep/swapped operands of `-`