mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
strategy: update dynamic spread after kline being filtered
This commit is contained in:
parent
0e76a90ee4
commit
7d3181f3fd
|
@ -671,6 +671,10 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
|||
return
|
||||
}
|
||||
|
||||
if kline.Symbol != s.Symbol || kline.Interval != s.Interval {
|
||||
return
|
||||
}
|
||||
|
||||
// Update spreads
|
||||
high := kline.GetHigh().Float64()
|
||||
open := kline.GetOpen().Float64()
|
||||
|
@ -704,10 +708,6 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
|||
log.Infof("new ask spread: %v", s.AskSpread.Percentage())
|
||||
}
|
||||
|
||||
if kline.Symbol != s.Symbol || kline.Interval != s.Interval {
|
||||
return
|
||||
}
|
||||
|
||||
if err := s.activeMakerOrders.GracefulCancel(ctx, s.session.Exchange); err != nil {
|
||||
log.WithError(err).Errorf("graceful cancel order error")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user