bollmaker: remove stopC

This commit is contained in:
c9s 2022-06-22 16:30:29 +08:00
parent c26d0d7824
commit 3150480db8
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -158,8 +158,6 @@ type Strategy struct {
groupID uint32
stopC chan struct{}
// defaultBoll is the BOLLINGER indicator we used for predicting the price.
defaultBoll *indicator.BOLL
@ -547,8 +545,6 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
s.orderExecutor.BindProfitStats(s.ProfitStats)
s.orderExecutor.Bind()
s.stopC = make(chan struct{})
s.orderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) {
bbgo.Sync(s)
})
@ -622,7 +618,6 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
s.Graceful.OnShutdown(func(ctx context.Context, wg *sync.WaitGroup) {
defer wg.Done()
close(s.stopC)
_ = s.orderExecutor.GracefulCancel(ctx)
})