-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
Conversation
Welcome back! @andycheng123, This pull request may get 215 BBG. |
pkg/bbgo/order_executor_general.go
Outdated
submitOrder.ReduceOnly = true | ||
if e.position.IsLong() { | ||
submitOrder.Side = types.SideTypeSell | ||
} else { |
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.
check e.position.IsShort() and avoid dust quantity?
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.
For futures, the dust position still can be closed if the order is reduced only
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
Re-estimated karma: this pull request may get 252 BBG |
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! |
No description provided.