How Stop Losses Work in Automated Trading