Indicators
Relative Momentum Index
Description
The Relative Momentum Index (RMI) calculates a ratio of upwards changes to downwards changes in prices over N-period bars. The RMI values range between 0 and 100. 30 and 70 are the two levels of oversold and overbought market conditions respectively. As the RMI indicator is closely related to the RSI, its interpretation and analysis is also similar to the RMI. The RMI indicator is an extremely helpful technical analysis tool that helps to determine the overall trend in the market and buying/selling opportunities.
For more information, please visit Patterns Wizard.
Params & Instance Methods
#initialize @param series [Array] An array of prices, typically closing prices @param period_mom [Integer] The number of periods to use in the momentum calculation - default is 14 @param period_rmi [Integer] The number of periods to use in the RMI calculation - default is 20 #call @return [Float] The current RMI value #valid? @return [Boolean] Whether or not the object is valid
Example
require 'ruby-technical-analysis' series = [6.875, 6.9375, 6.8125, 6.6095, 6.7345, 6.672, 6.625, 6.6875, 6.547, 6.6563, 6.672, 6.6563] period_mom = 4 period_rmi = 8 relative_momentum_index = RubyTechnicalAnalysis::RelativeMomentumIndex.new( series: series, period_mom: period_mom, period_rmi: period_rmi ) p relative_momentum_index.valid? # true p relative_momentum_index.call # 13.1179