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: [dca2] change state recovery logic #1640

Merged
merged 1 commit into from
May 24, 2024

Conversation

kbearXD
Copy link
Collaborator

@kbearXD kbearXD commented May 22, 2024

No description provided.

return fmt.Errorf("there is no %s in the balances %+v", s.Market.BaseCurrency, bals)
}

QuantityDiff := bal.Available.Sub(order.Quantity)
Copy link
Owner

Choose a reason for hiding this comment

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

lower case?

@@ -39,6 +39,27 @@ func (s *Strategy) placeTakeProfitOrders(ctx context.Context) error {
s.logger.Infof("position of this round before place the take-profit order: %s", roundPosition.String())

order := generateTakeProfitOrder(s.Market, s.TakeProfitRatio, roundPosition, s.OrderGroupID)

// verify the volume of order
bals, err := s.ExchangeSession.Exchange.QueryAccountBalances(ctx)
Copy link
Owner

Choose a reason for hiding this comment

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

you might need a retry here

@kbearXD kbearXD force-pushed the kbearXD/dca2/flexible-recovery branch from c2e19ab to 7134f51 Compare May 24, 2024 07:19
@kbearXD kbearXD merged commit c42c52d into main May 24, 2024
3 checks passed
@kbearXD kbearXD deleted the kbearXD/dca2/flexible-recovery branch May 24, 2024 07:54
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.

2 participants