This library has SmartTrail trail function that depends on the previous candle.
An example:
the Library first tests if new candle is formed, then in buying positions the trailing StopLoss moving on Low[1] (Low of Previous Bar) in one direction (Profit Direction); and vice versa in selling positions which moving on High[1].