-
Notifications
You must be signed in to change notification settings - Fork 143
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
Implement Stochastic RSI Indicator #37
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #37 +/- ##
==========================================
+ Coverage 98.36% 98.40% +0.03%
==========================================
Files 42 43 +1
Lines 611 626 +15
==========================================
+ Hits 601 616 +15
Misses 7 7
Partials 3 3
Continue to review full report at Codecov.
|
a6c5054
to
e4d4a5d
Compare
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.
Loving the new indicators, keep them coming! Just a couple questions on this one
indicator_stochastic_rsi.go
Outdated
} | ||
|
||
type rsiDIndicator struct { | ||
k Indicator |
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 give this a more descriptive name than k
?
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 can do that
indicator_stochastic_rsi.go
Outdated
maxRSI := sri.maxRSI.Calculate(index) | ||
|
||
if minRSI.EQ(maxRSI) { | ||
return big.NewDecimal(math.Inf(1)) |
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.
Why Inf
here? Wouldn't 0 be a better dummy value?
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.
The reason it's Inf
is simply because dividing by 0 tends to infinity. I'll set it to the maximum value (100).
https://www.investopedia.com/terms/s/stochrsi.asp