-
-
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: [indicator] add v2 MACD, SMA #1184
Conversation
Welcome back! @c9s, This pull request may get 483 BBG. |
@@ -82,21 +81,3 @@ func (inc *SMA) LoadK(allKLines []types.KLine) { | |||
inc.PushK(k) | |||
} | |||
} | |||
|
|||
func calculateSMA(kLines []types.KLine, window int, priceF KLineValueMapper) (float64, error) { |
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.
unused
Re-estimated karma: this pull request may get 498 BBG |
pkg/datatype/floats/slice.go
Outdated
@@ -191,14 +191,18 @@ func (s Slice) Last(i int) float64 { | |||
return s[length-1-i] | |||
} | |||
|
|||
func (s Slice) Truncate(size int) Slice { | |||
if len(s) < size { |
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.
Could be <=.
return s | ||
} | ||
|
||
return s[len(s)-size:] |
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.
What if size is less than or equal to 0?
Re-estimated karma: this pull request may get 604 BBG |
Re-estimated karma: this pull request may get 624 BBG |
Hi @c9s, Well done! 629 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0xf5110b44dc5af4646d0340505869529186690ff4064a5e89d8f3afbff35339f5 Thank you for your contribution! |
No description provided.