Merge pull request #435 from jessy1092/fix/correct-bollmaker-params

fix: Correct uptrendSkew and downtrendSkew parameters setting on bollmaker strategy
This commit is contained in:
Yo-An Lin 2022-01-14 12:18:18 +08:00 committed by GitHub
commit e797e597b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,13 +329,13 @@ func (s *Strategy) placeOrders(ctx context.Context, orderExecutor bbgo.OrderExec
}
} else if midPrice.Float64() > s.defaultBoll.LastDownBand() && midPrice.Float64() < s.neutralBoll.LastDownBand() { // downtrend, might bounce back
skew := 2.0
skew := s.DowntrendSkew.Float64()
ratio := 1.0 / skew
sellOrder.Quantity = math.Max(s.market.MinQuantity, buyOrder.Quantity*ratio)
} else if midPrice.Float64() < s.defaultBoll.LastUpBand() && midPrice.Float64() > s.neutralBoll.LastUpBand() { // uptrend, might bounce back
skew := 0.5
skew := s.UptrendSkew.Float64()
buyOrder.Quantity = math.Max(s.market.MinQuantity, sellOrder.Quantity*skew)
} else if midPrice.Float64() < s.defaultBoll.LastDownBand() { // strong downtrend