Class: Quant::Indicators::DecyclerPoint
- Inherits:
-
IndicatorPoint
- Object
- IndicatorPoint
- Quant::Indicators::DecyclerPoint
- Defined in:
- lib/quant/indicators/decycler.rb
Overview
The decycler oscillator can be useful for determining the transition be- tween uptrends and downtrends by the crossing of the zero line. Alternatively, the changes of slope of the decycler oscillator are easier to identify than the changes in slope of the original decycler. Optimum cutoff periods can easily be found by experimentation.
-
A decycler filter functions the same as a low-pass filter.
-
A decycler filter is created by subtracting the output of a high-pass filter from the input, thereby removing the high-frequency components by cancellation.
-
A decycler filter has very low lag.
-
A decycler oscillator is created by subtracting the output of a high-pass filter having a shorter cutoff period from the output of another high-pass filter having a longer cutoff period.
-
A decycler oscillator shows transitions between uptrends and down-trends at the zero crossings.
Instance Attribute Summary collapse
-
#agc ⇒ Object
Returns the value of attribute agc.
-
#decycle ⇒ Object
Returns the value of attribute decycle.
-
#hp1 ⇒ Object
Returns the value of attribute hp1.
-
#hp2 ⇒ Object
Returns the value of attribute hp2.
-
#ift ⇒ Object
Returns the value of attribute ift.
-
#osc ⇒ Object
Returns the value of attribute osc.
-
#peak ⇒ Object
Returns the value of attribute peak.
Attributes inherited from IndicatorPoint
Instance Method Summary collapse
Methods inherited from IndicatorPoint
Methods included from Attributes
deregister, included, register, registry
Constructor Details
This class inherits a constructor from Quant::Indicators::IndicatorPoint
Instance Attribute Details
#agc ⇒ Object
Returns the value of attribute agc.
17 18 19 |
# File 'lib/quant/indicators/decycler.rb', line 17 def agc @agc end |
#decycle ⇒ Object
Returns the value of attribute decycle.
17 18 19 |
# File 'lib/quant/indicators/decycler.rb', line 17 def decycle @decycle end |
#hp1 ⇒ Object
Returns the value of attribute hp1.
17 18 19 |
# File 'lib/quant/indicators/decycler.rb', line 17 def hp1 @hp1 end |
#hp2 ⇒ Object
Returns the value of attribute hp2.
17 18 19 |
# File 'lib/quant/indicators/decycler.rb', line 17 def hp2 @hp2 end |
#ift ⇒ Object
Returns the value of attribute ift.
17 18 19 |
# File 'lib/quant/indicators/decycler.rb', line 17 def ift @ift end |
#osc ⇒ Object
Returns the value of attribute osc.
17 18 19 |
# File 'lib/quant/indicators/decycler.rb', line 17 def osc @osc end |
#peak ⇒ Object
Returns the value of attribute peak.
17 18 19 |
# File 'lib/quant/indicators/decycler.rb', line 17 def peak @peak end |
Instance Method Details
#initialize_data_points(indicator:) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/quant/indicators/decycler.rb', line 28 def initialize_data_points(indicator:) @decycle = oc2 @hp1 = 0.0 @hp2 = 0.0 @osc = 0.0 @peak = 0.0 @agc = 0.0 end |
#to_h ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/quant/indicators/decycler.rb', line 19 def to_h { "dc" => decycle, "hp1" => hp1, "hp2" => hp2, "osc" => osc, } end |