Indicators

Wilder's Smoothing


Description

Wilder's Smoothing is a technical analysis indicator created by J. Welles Wilder, Jr. and is part of the Wilder's RSI indicator implementation. Like any other moving average, this indicator smoothes price movements to help you identify and spot bullish and bearish trends.

For more information, please visit QuantShare.


Params & Instance Methods

#initialize
@param series [Array] An array of prices
@param period [Integer] The number of periods to use in the calculation - default is 5

#call
@return [Float] The current Wilders Smoothing value

#valid?
@return [Boolean] Whether or not the object is valid

Example

require 'ruby-technical-analysis'

series = [62.125, 61.125, 62.3438, 65.3125, 63.9688, 63.4375]
period = 5

wilders_smoothing = 
  RubyTechnicalAnalysis::WildersSmoothing.new(
    series: series,
    period: period
  )

p wilders_smoothing.valid? # true

p wilders_smoothing.call.truncate(4) # 63.0675