c9s / bbgo

The modern cryptocurrency trading bot framework written in Go.
https://bbgo.finance
GNU Affero General Public License v3.0
1.18k stars 283 forks source link

FIX: [ActiveOrderBook] use origin order if error occurred #1555

Closed bailantaotao closed 6 months ago

bailantaotao commented 6 months ago

If errors occur in CancelOrders and QueryOpenOrders, it will result in an infinite loop because the orders have been replaced with an empty slice.

bbgokarma-bot commented 6 months ago

Welcome back! @bailantaotao, This pull request may get 206 BBG.

bbgokarma-bot commented 6 months ago

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

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 21.74%. Comparing base (a392d8d) to head (751f82b). Report is 4 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/c9s/bbgo/pull/1555/graphs/tree.svg?width=650&height=150&src=pr&token=ZT7I56OV8K&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin)](https://app.codecov.io/gh/c9s/bbgo/pull/1555?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin) ```diff @@ Coverage Diff @@ ## main #1555 +/- ## ========================================== - Coverage 21.74% 21.74% -0.01% ========================================== Files 609 609 Lines 44046 44057 +11 ========================================== Hits 9579 9579 - Misses 33785 33796 +11 Partials 682 682 ``` | [Files](https://app.codecov.io/gh/c9s/bbgo/pull/1555?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin) | Coverage Δ | | |---|---|---| | [pkg/bbgo/activeorderbook.go](https://app.codecov.io/gh/c9s/bbgo/pull/1555?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin#diff-cGtnL2JiZ28vYWN0aXZlb3JkZXJib29rLmdv) | `24.91% <0.00%> (-0.09%)` | :arrow_down: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/c9s/bbgo/pull/1555/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/c9s/bbgo/pull/1555?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/c9s/bbgo/pull/1555?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin). Last update [a392d8d...751f82b](https://app.codecov.io/gh/c9s/bbgo/pull/1555?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yo-An+Lin).
bbgokarma-bot commented 6 months ago

Hi @bailantaotao,

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

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

Thank you for your contribution!