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

dca2: add more log and retry #1576

Merged
merged 1 commit into from Mar 12, 2024
Merged

dca2: add more log and retry #1576

merged 1 commit into from Mar 12, 2024

Conversation

kbearXD
Copy link
Collaborator

@kbearXD kbearXD commented Mar 12, 2024

No description provided.

@bbgokarma-bot
Copy link

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

@@ -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)
Copy link
Owner

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

Copy link
Owner

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()

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

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

Project coverage is 22.27%. Comparing base (c5dbd4b) to head (661b7be).

Additional details and impacted files

Impacted file tree graph

@@            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              
Files Coverage Δ
pkg/strategy/dca2/active_order_recover.go 0.00% <0.00%> (ø)
pkg/strategy/dca2/open_position.go 49.41% <0.00%> (ø)
pkg/strategy/dca2/take_profit.go 56.00% <0.00%> (ø)
pkg/strategy/dca2/strategy.go 0.70% <0.00%> (-0.04%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5dbd4b...661b7be. Read the comment docs.

@kbearXD kbearXD force-pushed the kbearXD/dca2/retry-and-add-log branch from 36b576b to 661b7be Compare March 12, 2024 06:54
@bbgokarma-bot
Copy link

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

@kbearXD kbearXD merged commit 2bcf6ef into main Mar 12, 2024
3 of 5 checks passed
@kbearXD kbearXD deleted the kbearXD/dca2/retry-and-add-log branch March 12, 2024 07:44
@bbgokarma-bot
Copy link

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!

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.

None yet

4 participants