-
-
Notifications
You must be signed in to change notification settings - Fork 301
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: recover the grid when there is error at grid opening #1152
base: main
Are you sure you want to change the base?
Conversation
Hi @kbearXD, This pull request may get 367 BBG. To receive BBG token, please left your polygon address as an issue comment in this pull request with the following format, e.g.,
Once this pull request is merged, your BBG token will be sent to your wallet. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1152 +/- ##
==========================================
- Coverage 19.98% 19.92% -0.07%
==========================================
Files 452 453 +1
Lines 34281 34387 +106
==========================================
Hits 6852 6852
- Misses 26883 26989 +106
Partials 546 546
Continue to review full report in Codecov by Sentry.
|
} | ||
} | ||
|
||
func (s *GridOrderStates) AddCreatedOrders(createdOrders ...types.Order) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just AddOrders ?
var errs error | ||
|
||
for _, order := range s.Orders { | ||
if order.OrderID == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if Order ID not 0 then continue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this if?
|
||
// Debug enables the debug mode | ||
Debug bool `json:"debug"` | ||
|
||
GridProfitStats *GridProfitStats `persistence:"grid_profit_stats"` | ||
Position *types.Position `persistence:"position"` | ||
|
||
// this is used to check all generated orders are placed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update comment GridOrderStates is used to ...
@@ -1230,14 +1240,33 @@ func (s *Strategy) debugOrders(desc string, orders []types.Order) { | |||
s.logger.Infof(sb.String()) | |||
} | |||
|
|||
func (s *Strategy) debugSubmitOrders(desc string, orders []types.SubmitOrder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a similar method already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but that's only for types.Order.
"go.uber.org/multierr" | ||
) | ||
|
||
type GridOrder struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call this OrderTag to avoid confusing?
RecoverGridByScanningTrades bool `json:"recoverGridByScanningTrades"` | ||
SkipSpreadCheck bool `json:"skipSpreadCheck"` | ||
RecoverGridByScanningTrades bool `json:"recoverGridByScanningTrades"` | ||
RecoverFailedOrdersWhenGridOpening bool `json:"recoverFailedOrdersWhenGridOpening"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to RecoverFailedOrdersWhenOpeningGrid
No description provided.