Merge pull request #792 from c9s/strategy/pivotshort

This commit is contained in:
Yo-An Lin 2022-07-02 01:32:29 +08:00 committed by GitHub
commit cc04d81346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -78,7 +78,7 @@ func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.Gener
}
if len(s.pivotLowPrices) == 0 {
log.Infof("currently there is no pivot low prices, skip placing orders...")
log.Infof("currently there is no pivot low prices, can not check break low...")
return
}

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