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

FIX: [grid2] fix issue when recovering with finalizing orders #1612

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

kbearXD
Copy link
Collaborator

@kbearXD kbearXD commented Apr 2, 2024

No description provided.

@bbgokarma-bot
Copy link

Welcome back! @kbearXD, This pull request may get 268 BBG.

@@ -544,7 +545,8 @@ func (e *GeneralOrderExecutor) ClosePosition(ctx context.Context, percentage fix
if queryOrderService, ok := e.session.Exchange.(types.ExchangeOrderQueryService); ok && !IsBackTesting {
switch submitOrder.Type {
case types.OrderTypeMarket:
_, err2 := retry.QueryOrderUntilFilled(ctx, queryOrderService, createdOrders[0].Symbol, createdOrders[0].OrderID)
isMax := exchange.IsMaxExchange(e.session.Exchange)
_, err2 := retry.QueryOrderUntilFilled(ctx, queryOrderService, createdOrders[0].Symbol, createdOrders[0].OrderID, isMax)
Copy link
Owner

Choose a reason for hiding this comment

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

can we not do this? this is a generic api

@kbearXD kbearXD force-pushed the kbearXD/grid2/fix-recover-with-finalizing-issue branch from dd3a3f4 to bfede2b Compare April 2, 2024 16:47
@bbgokarma-bot
Copy link

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

@kbearXD kbearXD requested a review from c9s April 2, 2024 16:48
@kbearXD kbearXD force-pushed the kbearXD/grid2/fix-recover-with-finalizing-issue branch from bfede2b to fdba537 Compare April 3, 2024 02:37
@bbgokarma-bot
Copy link

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

@@ -26,6 +27,10 @@ func SyncActiveOrder(ctx context.Context, ex types.Exchange, orderQueryService t
return isOrderUpdated, err
}

if updatedOrder == nil {
return isOrderUpdated, fmt.Errorf("updatedOrder is nil and there is no error, please check it")
Copy link
Owner

Choose a reason for hiding this comment

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

use unexpected error, order object is a nil pointer, please check common.SyncActiveOrder()

@bbgokarma-bot
Copy link

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

@c9s c9s force-pushed the kbearXD/grid2/fix-recover-with-finalizing-issue branch from 1dbc748 to 444c228 Compare April 8, 2024 11:54
@bbgokarma-bot
Copy link

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

@kbearXD kbearXD merged commit ffb2b27 into main Apr 8, 2024
3 checks passed
@kbearXD kbearXD deleted the kbearXD/grid2/fix-recover-with-finalizing-issue branch April 8, 2024 13:25
@bbgokarma-bot
Copy link

Hi @kbearXD,

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

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

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