-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
dca2: add more log and retry #1576
Conversation
Welcome back! @kbearXD, This pull request may get 291 BBG. |
pkg/strategy/dca2/strategy.go
Outdated
@@ -299,17 +312,17 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo. | |||
func (s *Strategy) updateTakeProfitPrice() { | |||
takeProfitRatio := s.TakeProfitRatio | |||
s.takeProfitPrice = s.Market.TruncatePrice(s.Position.AverageCost.Mul(fixedpoint.One.Add(takeProfitRatio))) | |||
s.logger.Infof("[DCA] cost: %s, ratio: %s, price: %s", s.Position.AverageCost, takeProfitRatio, s.takeProfitPrice) | |||
s.logger.Infof("cost: %s, ratio: %s, price: %s", s.Position.AverageCost, takeProfitRatio, s.takeProfitPrice) |
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.
s.Position.AverageCost.String() will be better
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.
but I think you can print the whole position, like s.Position.String()
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1576 +/- ##
==========================================
- Coverage 22.28% 22.27% -0.01%
==========================================
Files 615 615
Lines 44416 44431 +15
==========================================
Hits 9896 9896
- Misses 33814 33829 +15
Partials 706 706
Continue to review full report in Codecov by Sentry.
|
36b576b
to
661b7be
Compare
Re-estimated karma: this pull request may get 321 BBG |
Hi @kbearXD, Well done! 326 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0xfa2460c06b15109c6968d4647b23055c0d0456d6de95bc88c203da8f4f48443c Thank you for your contribution! |
No description provided.