Indicators
Chande Momentum Oscillator
Description
The Chande Momentum Oscillator (CMO) is a technical momentum indicator introduced by Tushar Chande in his 1994 book The New Technical Trader. The formula calculates the difference between the sum of recent gains and the sum of recent losses and then divides the result by the sum of all price movements over the same period.
For more information, please visit Investopedia.
Params & Instance Methods
#initialize @param series [Array] An array of prices, typically closing prices @param period [Integer] The number of periods to use in the calculation - default is 20 #call @return [Float] The current Chande Momentum Oscillator value #valid? @return [Boolean] Whether or not the object is valid
Example
require 'ruby-technical-analysis' series = [51.0625, 50.125, 52.3125, 52.1875, 53.1875, 53.0625] period = 5 chande_momentum_oscillator = RubyTechnicalAnalysis::ChandeMomentumOscillator.new( series: series, period: period ) p chande_momentum_oscillator.valid? # true p chande_momentum_oscillator.call.truncate(4) # 45.7143