Skip to content

Conversation

@guillemap
Copy link

@guillemap guillemap commented Jun 6, 2025

I added 3 fixes:

  1. Removed the rounding in the RSI calculation so the number is more precise

  2. Fixed the hardcoded percentages, they were swapped.

Note: these numbers are the same as the calculation in case the period is not 12 or 26. I imagine these values are rounded and hardcoded for some specific use case. Maybe they can be removed and use the universal formula instead?
(lines 65-67 of lib/ruby_technical_analysis/indicators/moving_averages.rb)

  1. Removed the data limitation of the EMA calculation, this allows the user to pass in a longer series than the EMA period and get a more precise EMA value.

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.

1 participant