pivotshort: fix findNextResistancePriceAndPlaceOrders

This commit is contained in:
c9s 2022-07-02 00:28:41 +08:00
parent f1867b02c3
commit 004e6b0e0b
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -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