From f49b7165d820f8acad3673ab002ace0b5b913040 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 27 Jan 2022 19:56:10 +0800 Subject: [PATCH] bollmaker: fix MinNotional adjustment --- config/bollmaker.yaml | 12 ------------ pkg/strategy/bollmaker/strategy.go | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/config/bollmaker.yaml b/config/bollmaker.yaml index e67d21d3c..4e698781b 100644 --- a/config/bollmaker.yaml +++ b/config/bollmaker.yaml @@ -74,18 +74,6 @@ exchangeStrategies: # THe short here means you might sell some of your existing inventory. disableShort: true - # strongUptrendSkew is the order quantity skew for strong uptrend band. - # when the bollinger band detect a strong uptrend, what's the order quantity skew we want to use. - # greater than 1.0 means when placing buy order, place sell order with less quantity - # less than 1.0 means when placing sell order, place buy order with less quantity - strongUptrendSkew: 0.3 - - # strongDowntrendSkew is the order quantity skew for strong downtrend band. - # when the bollinger band detect a strong downtrend, what's the order quantity skew we want to use. - # greater than 1.0 means when placing buy order, place sell order with less quantity - # less than 1.0 means when placing sell order, place buy order with less quantity - strongDowntrendSkew: 2.0 - # uptrendSkew, like the strongUptrendSkew, but the price is still in the default band. uptrendSkew: 0.8 diff --git a/pkg/strategy/bollmaker/strategy.go b/pkg/strategy/bollmaker/strategy.go index ad4a72a0a..2613c84f7 100644 --- a/pkg/strategy/bollmaker/strategy.go +++ b/pkg/strategy/bollmaker/strategy.go @@ -461,7 +461,7 @@ func (s *Strategy) detectPriceTrend(inc *indicator.BOLL, price float64) PriceTre func (s *Strategy) adjustOrderQuantity(submitOrder types.SubmitOrder) types.SubmitOrder { if submitOrder.Quantity*submitOrder.Price < s.market.MinNotional { - submitOrder.Quantity = bbgo.AdjustFloatQuantityByMinAmount(submitOrder.Quantity, submitOrder.Price, s.market.MinNotional) + submitOrder.Quantity = bbgo.AdjustFloatQuantityByMinAmount(submitOrder.Quantity, submitOrder.Price, s.market.MinNotional * 1.1) } if submitOrder.Quantity < s.market.MinQuantity {