Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tsubus
Copy link
Contributor

@tsubus tsubus commented Mar 8, 2021

@codecov
Copy link

codecov bot commented Mar 8, 2021

Codecov Report

Merging #37 (b00fdf4) into main (572c478) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
indicator_stochastic_rsi.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 572c478...b00fdf4. Read the comment docs.

@tsubus tsubus force-pushed the stochastic_rsi branch 2 times, most recently from a6c5054 to e4d4a5d Compare March 8, 2021 16:52
Copy link
Owner

@sdcoffey sdcoffey left a 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

}

type rsiDIndicator struct {
k Indicator
Copy link
Owner

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that

maxRSI := sri.maxRSI.Calculate(index)

if minRSI.EQ(maxRSI) {
return big.NewDecimal(math.Inf(1))
Copy link
Owner

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?

Copy link
Contributor Author

@tsubus tsubus Mar 25, 2021

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants