-
-
Notifications
You must be signed in to change notification settings - Fork 293
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: [atrpin] take profit by expected base balance #1648
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1648 +/- ##
==========================================
- Coverage 22.71% 22.66% -0.06%
==========================================
Files 619 619
Lines 44697 44661 -36
==========================================
- Hits 10153 10121 -32
+ Misses 33810 33807 -3
+ Partials 734 733 -1 see 8 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
pkg/strategy/atrpin/strategy.go
Outdated
if baseQuantity.Sign() < 0 { | ||
side = types.SideTypeBuy | ||
takerPrice = ticker.Sell | ||
baseQuantity = baseQuantity.Abs() |
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.
I think you can check the ClosePosition() method, and maybe we can reuse some of them
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.
If there is a missing trade, then the position base will be incorrect. Thus I'd like to add the ExpectedBaseBalance
to solve the problem.
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.
can we use query trades to fix the position?
the balance balance could be fixed by xalign, and we will need a correct PnL record
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.
we can't fix the balance by xalign, because atrpin will place order
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.
how to query trades?
852d30f
to
dd80a8e
Compare
dd80a8e
to
e40e556
Compare
60e8267
to
7361838
Compare
7361838
to
a1b8e07
Compare
No description provided.