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

fix: general order executor: ClosePosition() works on futures position #986

Merged
merged 2 commits into from
Oct 7, 2022

Conversation

andycheng123
Copy link
Collaborator

No description provided.

@bbgokarma-bot
Copy link

Welcome back! @andycheng123, This pull request may get 215 BBG.

submitOrder.ReduceOnly = true
if e.position.IsLong() {
submitOrder.Side = types.SideTypeSell
} else {
Copy link
Owner

Choose a reason for hiding this comment

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

check e.position.IsShort() and avoid dust quantity?

Copy link
Collaborator Author

@andycheng123 andycheng123 Oct 7, 2022

Choose a reason for hiding this comment

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

For futures, the dust position still can be closed if the order is reduced only

@codecov
Copy link

codecov bot commented Oct 7, 2022

Codecov Report

Merging #986 (5ad247c) into main (34866ce) will decrease coverage by 0.00%.
The diff coverage is 42.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #986      +/-   ##
==========================================
- Coverage   19.91%   19.90%   -0.01%     
==========================================
  Files         420      420              
  Lines       31907    31922      +15     
==========================================
+ Hits         6353     6354       +1     
- Misses      24949    24962      +13     
- Partials      605      606       +1     
Impacted Files Coverage Δ
pkg/bbgo/order_executor_general.go 17.10% <42.85%> (-0.55%) ⬇️

Continue to review full report at Codecov.

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

@bbgokarma-bot
Copy link

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

@andycheng123 andycheng123 merged commit 1744281 into c9s:main Oct 7, 2022
@bbgokarma-bot
Copy link

Hi @andycheng123,

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

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

Thank you for your contribution!

@andycheng123 andycheng123 deleted the fix/protective-stop branch October 7, 2022 05:44
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