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

add method WsCombinedKlineServe to Binance Future #258

Closed
wants to merge 3 commits into from

Conversation

ramilexe
Copy link
Contributor

@ramilexe ramilexe commented Apr 7, 2023

Related to #257

@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.38 ⚠️

Comparison is base (9f24c58) 40.44% compared to head (67dcd8a) 40.06%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #258      +/-   ##
==========================================
- Coverage   40.44%   40.06%   -0.38%     
==========================================
  Files          19       19              
  Lines        2893     2920      +27     
==========================================
  Hits         1170     1170              
- Misses       1647     1674      +27     
  Partials       76       76              
Impacted Files Coverage Δ
exchange/binance.go 2.19% <0.00%> (-0.01%) ⬇️
exchange/binance_future.go 0.00% <0.00%> (ø)
exchange/csvfeed.go 64.25% <0.00%> (-0.59%) ⬇️
exchange/exchange.go 0.00% <ø> (ø)
exchange/paperwallet.go 68.72% <0.00%> (-0.27%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Owner

@rodrigo-brito rodrigo-brito left a comment

Choose a reason for hiding this comment

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

Hi @ramilexe, nice job!
I would like to understand what is the benefit of including this new signature in the exchange interface.

exchange/binance.go Outdated Show resolved Hide resolved
@@ -14,6 +15,8 @@ import (
"github.com/rodrigo-brito/ninjabot/tools/log"
)

var _ service.Feeder = &Binance{}
Copy link
Owner

@rodrigo-brito rodrigo-brito Apr 7, 2023

Choose a reason for hiding this comment

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

What is the purpose of this instance? To force the implementation of the interface?

}
}
}()
go b.candleSubscription(ctx, ha, ccandle, cerr, pair, period, nil, false)
Copy link
Owner

Choose a reason for hiding this comment

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

why pairs parameter is nil here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because method candleSubscription handles both cases: for single pair-period (CandlesSubscription) and for multiple pairs (CandlesSubscriptionCombined)

@@ -516,6 +519,10 @@ func (b *Binance) CandlesSubscription(ctx context.Context, pair, period string)
return ccandle, cerr
}

func (b *Binance) CandlesSubscriptionCombined(_ context.Context, _ map[string]string) (chan model.Candle, chan error) {
panic("not implemented")
Copy link
Owner

Choose a reason for hiding this comment

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

We do not have this for Spot market?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest implementing it in following PR to not overcomplicate this one

@ramilexe
Copy link
Contributor Author

ramilexe commented Apr 7, 2023

I would like to understand what is the benefit of including this new signature in the exchange interface.

Do you have idea how we can do it without including new function into interface?

@rodrigo-brito
Copy link
Owner

Do you have idea how we can do it without including new function into interface?

If your idea is just to optimize the CandlesSubscription method to reduce the number of open websockets. We can just override the subscription logic to always use this approach. I see no point in keeping both.

Are you consuming the Exchange object outside of a strategy?

@ramilexe ramilexe closed this Jul 25, 2024
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.

3 participants