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: [okx] support query open orders #1498

Merged
merged 2 commits into from Jan 14, 2024

Conversation

bailantaotao
Copy link
Collaborator

No description provided.

@bbgokarma-bot
Copy link

Welcome back! @bailantaotao, This pull request may get 934 BBG.

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 39 lines in your changes are missing coverage. Please review.

Comparison is base (c01be14) 21.60% compared to head (228bfba) 21.70%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1498      +/-   ##
==========================================
+ Coverage   21.60%   21.70%   +0.10%     
==========================================
  Files         605      606       +1     
  Lines       44101    44112      +11     
==========================================
+ Hits         9527     9576      +49     
+ Misses      33879    33841      -38     
  Partials      695      695              
Files Coverage Δ
pkg/exchange/okex/okexapi/trade.go 0.00% <ø> (ø)
pkg/fixedpoint/convert.go 43.09% <0.00%> (ø)
pkg/exchange/okex/okexapi/client.go 11.30% <0.00%> (-0.21%) ⬇️
pkg/exchange/okex/convert.go 19.10% <89.18%> (+18.23%) ⬆️
...g/exchange/okex/okexapi/get_open_orders_request.go 0.00% <0.00%> (ø)
pkg/exchange/okex/exchange.go 0.00% <0.00%> (ø)

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 c01be14...228bfba. Read the comment docs.

@bbgokarma-bot
Copy link

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

@@ -58,6 +58,10 @@ const (
OrderStateFilled OrderState = "filled"
)

func (o OrderState) IsWorking() bool {
return o == OrderStateLive || o == OrderStatePartiallyFilled
Copy link
Owner

Choose a reason for hiding this comment

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

I guess you can use switch case 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.

Why? The function represents only the working status- either live or partially filled.

Copy link
Owner

Choose a reason for hiding this comment

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

like this:

switch o {  case OrderStateLive, OrderStatePartiallyFilled: return true;  default: return false  }

// Options price in USDOnly applicable to options; return "" for other instrument types
PriceUsd string `json:"pxUsd"`
// Implied volatility of the options orderOnly applicable to options; return "" for other instrument types
PriceVol string `json:"pxVol"`
Copy link
Owner

Choose a reason for hiding this comment

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

decided not to use fixedpoint.Value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the field is only used in options, I ignore it. XD

i can update it

@bbgokarma-bot
Copy link

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

@bbgokarma-bot
Copy link

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


req := e.client.NewGetOpenOrdersRequest().
InstrumentID(instrumentID).
After(fmt.Sprintf("%d", nextCursor))
Copy link
Owner

Choose a reason for hiding this comment

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

better to use strconv.Itoa

strconv.Itoa is faster than fmt.Sprintf

@bbgokarma-bot
Copy link

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

@bailantaotao bailantaotao merged commit 03449d0 into main Jan 14, 2024
4 checks passed
@bailantaotao bailantaotao deleted the edwin/okx/query-open-orders branch January 14, 2024 08:00
@bbgokarma-bot
Copy link

Hi @bailantaotao,

Well done! 1024 BBG has been sent to your polygon wallet. Please check the following tx:

https://polygonscan.com/tx/0x5169f2b98c958c008164075a2a567f35f5f73459ebfb797eeefdc2e15ae1aa85

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

3 participants