improve/exit: use roi.Percentage() instead of roi.Float64()

This commit is contained in:
Andy Cheng 2023-03-08 17:12:41 +08:00
parent 2970f73542
commit 58b2678ae8
No known key found for this signature in database
GPG Key ID: 936427CF651A9D28

View File

@ -100,7 +100,7 @@ func (s *TrailingStop2) checkStopPrice(price fixedpoint.Value, position *types.P
// check if we have the minimal profit
roi := position.ROI(price)
if roi.Compare(s.MinProfit) >= 0 {
Notify("[trailingStop] activated: %s ROI %f > minimal profit ratio %f", s.Symbol, roi.Float64(), s.MinProfit.Float64())
Notify("[trailingStop] activated: %s ROI %f > minimal profit ratio %f", s.Symbol, roi.Percentage(), s.MinProfit.Float64())
s.activated = true
}
} else if !s.ActivationRatio.IsZero() {