From 37413e4355f3cdecc94e5b29d429d659a26f6977 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 28 Jun 2022 22:17:55 +0800 Subject: [PATCH] pivotshort: fix bounce ratio calculation --- pkg/strategy/pivotshort/strategy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/strategy/pivotshort/strategy.go b/pkg/strategy/pivotshort/strategy.go index 3ad933f1f..8704eb26b 100644 --- a/pkg/strategy/pivotshort/strategy.go +++ b/pkg/strategy/pivotshort/strategy.go @@ -361,7 +361,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se bbgo.Notify("%s price %f breaks the previous low %f with ratio %f, submitting market sell to open a short position", s.Symbol, kline.Close.Float64(), previousLow.Float64(), s.BreakLow.Ratio.Float64()) s.placeMarketSell(ctx, quantity, "breakLowMarket") } else { - sellPrice := kline.Close.Mul(fixedpoint.One.Add(s.BreakLow.BounceRatio)) + sellPrice := previousLow.Mul(fixedpoint.One.Add(s.BreakLow.BounceRatio)) bbgo.Notify("%s price %f breaks the previous low %f with ratio %f, submitting limit sell @ %f", s.Symbol, kline.Close.Float64(), previousLow.Float64(), s.BreakLow.Ratio.Float64(), sellPrice.Float64()) s.placeLimitSell(ctx, sellPrice, quantity, "breakLowLimit")