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: add portfolio rebalancing strategy #357

Merged
merged 2 commits into from
Dec 14, 2021
Merged

Conversation

narumiruna
Copy link
Collaborator

No description provided.


func (p *Portfolio) PrintValue() {
value := p.TotalValue()
log.Infof("portfolio value: %f %s", value.Float64(), p.BaseCurrency)
Copy link
Owner

Choose a reason for hiding this comment

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

you can use market.BaseCurrencyFormatter and market.QuoteCurrencyFormatter


}

func (s *Strategy) Rebalance(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) {
Copy link
Owner

Choose a reason for hiding this comment

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

if verbose than shows "Rebalancing..." here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

沒有特別想放什麼,拿掉好了XD

@narumiruna narumiruna marked this pull request as ready for review December 13, 2021 18:19
Copy link
Owner

@c9s c9s left a comment

Choose a reason for hiding this comment

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

awesome, thanks!

@c9s c9s merged commit 18785eb into c9s:main Dec 14, 2021
c9s added a commit that referenced this pull request Dec 18, 2021
feature: add portfolio rebalancing strategy
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