Skip to content

Commit 0e877b7

Browse files
authored
Merge pull request #748 from andycheng123/improve/bollmaker
bollmaker: remove redundant code for adapting new order executor api
2 parents 74e8540 + cc7b8c8 commit 0e877b7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/strategy/bollmaker/strategy.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func (s *Strategy) getCurrentAllowedExposurePosition(bandPercentage float64) (fi
269269
return s.MaxExposurePosition, nil
270270
}
271271

272-
func (s *Strategy) placeOrders(ctx context.Context, orderExecutor bbgo.OrderExecutor, midPrice fixedpoint.Value, kline *types.KLine) {
272+
func (s *Strategy) placeOrders(ctx context.Context, midPrice fixedpoint.Value, kline *types.KLine) {
273273
bidSpread := s.Spread
274274
if s.BidSpread.Sign() > 0 {
275275
bidSpread = s.BidSpread
@@ -598,10 +598,10 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
598598
}
599599

600600
midPrice := ticker.Buy.Add(ticker.Sell).Div(two)
601-
s.placeOrders(ctx, orderExecutor, midPrice, nil)
601+
s.placeOrders(ctx, midPrice, nil)
602602
} else {
603603
if price, ok := session.LastPrice(s.Symbol); ok {
604-
s.placeOrders(ctx, orderExecutor, price, nil)
604+
s.placeOrders(ctx, price, nil)
605605
}
606606
}
607607
})
@@ -641,9 +641,9 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
641641

642642
midPrice := ticker.Buy.Add(ticker.Sell).Div(two)
643643
log.Infof("using ticker price: bid %v / ask %v, mid price %v", ticker.Buy, ticker.Sell, midPrice)
644-
s.placeOrders(ctx, orderExecutor, midPrice, &kline)
644+
s.placeOrders(ctx, midPrice, &kline)
645645
} else {
646-
s.placeOrders(ctx, orderExecutor, kline.Close, &kline)
646+
s.placeOrders(ctx, kline.Close, &kline)
647647
}
648648
})
649649

0 commit comments

Comments
 (0)