Class: RubyTechnicalAnalysis::WildersSmoothing
- Defined in:
- lib/ruby_technical_analysis/indicators/wilders_smoothing.rb
Overview
Wilders Smoothing
Instance Attribute Summary collapse
-
#period ⇒ Object
readonly
Returns the value of attribute period.
Attributes inherited from Indicator
Instance Method Summary collapse
-
#call ⇒ Float
The current Wilders Smoothing value.
-
#initialize(series: [], period: 5) ⇒ WildersSmoothing
constructor
A new instance of WildersSmoothing.
-
#valid? ⇒ Boolean
Whether or not the object is valid.
Methods inherited from Indicator
Constructor Details
#initialize(series: [], period: 5) ⇒ WildersSmoothing
Returns a new instance of WildersSmoothing.
8 9 10 11 12 |
# File 'lib/ruby_technical_analysis/indicators/wilders_smoothing.rb', line 8 def initialize(series: [], period: 5) @period = period super(series: series) end |
Instance Attribute Details
#period ⇒ Object (readonly)
Returns the value of attribute period.
4 5 6 |
# File 'lib/ruby_technical_analysis/indicators/wilders_smoothing.rb', line 4 def period @period end |
Instance Method Details
#call ⇒ Float
Returns The current Wilders Smoothing value.
15 16 17 |
# File 'lib/ruby_technical_analysis/indicators/wilders_smoothing.rb', line 15 def call calculate_wilders_smoothing end |
#valid? ⇒ Boolean
Returns Whether or not the object is valid.
20 21 22 |
# File 'lib/ruby_technical_analysis/indicators/wilders_smoothing.rb', line 20 def valid? period < series.length end |