The concept of the Stop loss function is to study levels of the price line, and apply predetermined indicators to flag potential buy and sell points.
Long Stop Loss Function
Short Stop Loss Function