-
-
Notifications
You must be signed in to change notification settings - Fork 302
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
[dca2] add dev mode field for dev #1515
Conversation
Welcome back! @kbearXD, This pull request may get 251 BBG. |
chiahung.lin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1515 +/- ##
==========================================
- Coverage 21.78% 21.77% -0.01%
==========================================
Files 604 605 +1
Lines 43885 43879 -6
==========================================
- Hits 9559 9556 -3
+ Misses 33643 33642 -1
+ Partials 683 681 -2
... and 12 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
pkg/strategy/dca2/dev_mode.go
Outdated
|
||
// DevMode, if Enabled is true. it means it will check the running field | ||
type DevMode struct { | ||
On bool `json:"on"` |
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.
use enabled
pkg/strategy/dca2/dev_mode.go
Outdated
// DevMode, if Enabled is true. it means it will check the running field | ||
type DevMode struct { | ||
On bool `json:"on"` | ||
IsNewStrategy bool `json:"isNewStrategy"` |
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 about newAccount
?
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.
Actually, it's not new account. This field is used to make dca2 strategy not recover with long time ago trades.
pkg/strategy/dca2/strategy.go
Outdated
@@ -66,6 +66,9 @@ type Strategy struct { | |||
// UseCancelAllOrdersApiWhenClose uses a different API to cancel all the orders on the market when closing a grid | |||
UseCancelAllOrdersApiWhenClose bool `json:"useCancelAllOrdersApiWhenClose"` | |||
|
|||
// dev mode | |||
DevMode DevMode `json:"devMode"` |
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.
would be better to use DevMode *DevMode
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 if we use pointer here, we can remove Enabled field.
pkg/strategy/dca2/open_position.go
Outdated
@@ -32,6 +33,21 @@ func (s *Strategy) placeOpenPositionOrders(ctx context.Context) error { | |||
|
|||
s.debugOrders(createdOrders) | |||
|
|||
if s.DevMode.On && s.DevMode.IsNewStrategy { |
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.
and check s.DevMode != nil here
Re-estimated karma: this pull request may get 326 BBG |
Re-estimated karma: this pull request may get 331 BBG |
Re-estimated karma: this pull request may get 372 BBG |
6f21b34
to
ddd2117
Compare
Re-estimated karma: this pull request may get 377 BBG |
ddd2117
to
daeb5fc
Compare
Re-estimated karma: this pull request may get 382 BBG |
daeb5fc
to
3f6fffa
Compare
Re-estimated karma: this pull request may get 394 BBG |
3f6fffa
to
54ea684
Compare
Re-estimated karma: this pull request may get 399 BBG |
use pointer IsNewStrategy -> IsNewAccount [dca2] recover at cancelling stage new var recoverSinceLimit fix profit stats round bug
54ea684
to
dfb65ba
Compare
Re-estimated karma: this pull request may get 404 BBG |
Hi @kbearXD, Well done! 409 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0xae83f4b02970a7b592932a581875d165986d72811e5db2d10677e9c3254b0e40 Thank you for your contribution! |
No description provided.