take the stop loss function as common