In the app file trading.py: lossprice = stopprice - (stopprice * self.stop_loss / 100) I think it should be lossprice = stop_order['price'] - (stop_order['price'] * self.stop_loss / 100)