Fixed the calculation of the stoploss.