-
-
Notifications
You must be signed in to change notification settings - Fork 269
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: add autobuy strategy #1468
Conversation
Welcome back! @narumiruna, This pull request may get 382 BBG. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1468 +/- ##
=======================================
Coverage 21.32% 21.32%
=======================================
Files 591 591
Lines 43482 43482
=======================================
Hits 9274 9274
Misses 33533 33533
Partials 675 675 Continue to review full report in Codecov by Sentry.
|
pkg/strategy/autobuy/strategy.go
Outdated
|
||
s.boll = session.Indicators(s.Symbol).BOLL(s.BollingerSetting.IntervalWindow, s.BollingerSetting.BandWidth) | ||
|
||
session.UserDataStream.OnBalanceUpdate(func(balances types.BalanceMap) { |
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.
BalanceUpdate could be triggered very fast, you will need to use rate limiter
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 changed to do this on order filled.
pkg/strategy/autobuy/strategy.go
Outdated
return | ||
} | ||
|
||
price := ticker.Buy |
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.
it could also be "ticker.Sell - one tick" if we want to be filled faster?
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.
this could be an option
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
var price fixedpoint.Value
switch s.PriceType {
case PriceTypeLast:
price = ticker.Last
case PriceTypeBuy:
price = ticker.Buy
case PriceTypeSell:
price = ticker.Sell
case PriceTypeMid:
price = ticker.Buy.Add(ticker.Sell).Div(two)
default:
price = ticker.Buy
}
ab2a832
to
8c2c3c0
Compare
Re-estimated karma: this pull request may get 482 BBG |
8c2c3c0
to
687df81
Compare
Re-estimated karma: this pull request may get 497 BBG |
Hi @narumiruna, Well done! 512 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0x6b81a106096c1dc6fb98a99c6d159266c3a26743d4b7dbdfd29372a27e8d029e Thank you for your contribution! |
No description provided.