mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
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:
commit
e797e597b1
|
@ -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
|
} 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
|
ratio := 1.0 / skew
|
||||||
sellOrder.Quantity = math.Max(s.market.MinQuantity, buyOrder.Quantity*ratio)
|
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
|
} 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)
|
buyOrder.Quantity = math.Max(s.market.MinQuantity, sellOrder.Quantity*skew)
|
||||||
|
|
||||||
} else if midPrice.Float64() < s.defaultBoll.LastDownBand() { // strong downtrend
|
} else if midPrice.Float64() < s.defaultBoll.LastDownBand() { // strong downtrend
|
||||||
|
|
Loading…
Reference in New Issue
Block a user