-
-
Notifications
You must be signed in to change notification settings - Fork 343
FEATURE: [okx] Support updating the local cache of symbols when calling QueryMarkets #2007
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2007 +/- ##
==========================================
- Coverage 22.95% 22.79% -0.17%
==========================================
Files 671 673 +2
Lines 51990 52323 +333
==========================================
- Hits 11935 11926 -9
- Misses 39173 39524 +351
+ Partials 882 873 -9
... and 14 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
pkg/exchange/okex/convert.go
Outdated
@@ -16,7 +16,7 @@ func toGlobalSymbol(symbol string) string { | |||
} | |||
|
|||
//go:generate go run gensymbols.go | |||
func toLocalSymbol(symbol string, instType ...okexapi.InstrumentType) string { | |||
func ToLocalSymbol(symbol string, instType ...okexapi.InstrumentType) string { |
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.
please avoid export converter function since it's only used in the okx package
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.
Got it — if we don’t export the converter
method, we won’t be able to call OKX-specific functions like SetAccountLeverage
inside the strategy, since we need to convert from the global symbol to the local symbol first.
So, could we maybe add this kind of special function directly to the Exchange instead?
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.
yes, you can add public methods on Exchange, and in your strategy, you cast the exchange interface into *okx.Exchange to use these methods
8797756
to
3c58fbf
Compare
3c58fbf
to
75a13f3
Compare
No description provided.