From 004e6b0e0b3440d3c20caba8a8d821da02418988 Mon Sep 17 00:00:00 2001 From: c9s Date: Sat, 2 Jul 2022 00:28:41 +0800 Subject: [PATCH] pivotshort: fix findNextResistancePriceAndPlaceOrders --- pkg/strategy/pivotshort/resistance.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/strategy/pivotshort/resistance.go b/pkg/strategy/pivotshort/resistance.go index 39b18346a..b26fc62d0 100644 --- a/pkg/strategy/pivotshort/resistance.go +++ b/pkg/strategy/pivotshort/resistance.go @@ -64,6 +64,10 @@ func (s *ResistanceShort) Bind(session *bbgo.ExchangeSession, orderExecutor *bbg } func (s *ResistanceShort) findNextResistancePriceAndPlaceOrders(closePrice fixedpoint.Value) { + // if the close price is still lower than the resistance price, then we don't have to update + if closePrice.Compare(s.nextResistancePrice) <= 0 { + return + } minDistance := s.MinDistance.Float64() lows := s.resistancePivot.Lows