Indicators
Envelopes EMA
Description
Moving averages (MA) are a popular trading tool. Unfortunately, they are prone to giving false signals in choppy markets. By applying an envelope to the moving average, some of these whipsaw trades can be avoided, and traders can increase their profits. Envelopes trading has been a favorite tool among technical analysts for years, and incorporating that technique with MAs makes for a useful combination.
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 @param percent [Integer] The percent to use in the calculation - default is 5 #call @return [Array] An array containing the current upper, middle, and lower bands of the series #valid? @return [Boolean] Whether or not the object is valid
Example
require 'ruby-technical-analysis' series = [25, 24.875, 24.781, 24.594, 24.5] period = 5 percent = 20 envelopes_ema = RubyTechnicalAnalysis::EnvelopesEma.new( series: series, period: period, percent: percent ) p envelopes_ema.valid? # true p envelopes_ema.call # [29.637, 24.698, 19.758]