Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: add universal cancel all orders api helper #1545

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

c9s
Copy link
Owner

@c9s c9s commented Feb 23, 2024

No description provided.

@bbgokarma-bot
Copy link

Welcome back! @c9s, This pull request may get 341 BBG.

Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 68 lines in your changes are missing coverage. Please review.

Project coverage is 21.73%. Comparing base (945c442) to head (0b0bc7e).
Report is 8 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1545      +/-   ##
==========================================
- Coverage   21.77%   21.73%   -0.04%     
==========================================
  Files         606      607       +1     
  Lines       43939    44004      +65     
==========================================
  Hits         9566     9566              
- Misses      33691    33756      +65     
  Partials      682      682              
Files Coverage Δ
pkg/bbgo/graceful_shutdown.go 0.00% <ø> (ø)
pkg/exchange/max/convert.go 22.50% <ø> (ø)
pkg/strategy/dca2/strategy.go 0.84% <0.00%> (+0.01%) ⬆️
pkg/util/tradingutil/cancel.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 945c442...0b0bc7e. Read the comment docs.

s.logger.WithError(err).Errorf("CancelOrdersByGroupID api call error")
werr = multierr.Append(werr, err)
s.logger.WithError(err).Errorf("unable to query open orders")
continue
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this hit api rate limit?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have the protection in the exchange api layer

return symbols
}

func CollectOpenOrders(ctx context.Context, ex types.Exchange, symbols ...string) ([]types.Order, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this method get called?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be used from xtri

}
}

return fmt.Errorf("unable to cancel all orders: %+v", openOrders)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding anyErr?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@bbgokarma-bot
Copy link

Re-estimated karma: this pull request may get 404 BBG

@c9s c9s requested a review from gx578007 February 24, 2024 06:04
@c9s c9s merged commit 4f57c5b into main Feb 27, 2024
3 of 5 checks passed
@c9s c9s deleted the feat/add-universal-cancel-all-orders branch February 27, 2024 14:12
@bbgokarma-bot
Copy link

Hi @c9s,

Well done! 429 BBG has been sent to your polygon wallet. Please check the following tx:

https://polygonscan.com/tx/0xaf64b84ca7175ed6fe1fb23fec39481c8be51c2a4c9fa02984150db6fdf85071

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants