mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
xmaker: call cancel orders everytime
This commit is contained in:
parent
ce63641d70
commit
405f9c863f
|
@ -512,13 +512,13 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
|
|
||||||
if err := s.makerSession.Exchange.CancelOrders(ctx, s.activeMakerOrders.Orders()...); err != nil {
|
|
||||||
log.WithError(err).Errorf("can not cancel %s orders", s.Symbol)
|
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
if err := s.makerSession.Exchange.CancelOrders(ctx, s.activeMakerOrders.Orders()...); err != nil {
|
||||||
|
log.WithError(err).Errorf("can not cancel %s orders", s.Symbol)
|
||||||
|
}
|
||||||
|
|
||||||
log.Warnf("waiting for orders to be cancelled...")
|
log.Warnf("waiting for orders to be cancelled...")
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(3 * time.Second)
|
||||||
|
|
||||||
orders := s.activeMakerOrders.Orders()
|
orders := s.activeMakerOrders.Orders()
|
||||||
if len(orders) == 0 {
|
if len(orders) == 0 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user