A stop-loss order is a mechanism that automatically exits a transaction if the stock price swings against the trader, reducing possible losses.