Class: Quant::Indicators::Pivots::Donchian
- Inherits:
-
Quant::Indicators::Pivot
- Object
- Indicator
- Quant::Indicators::Pivot
- Quant::Indicators::Pivots::Donchian
- Defined in:
- lib/quant/indicators/pivots/donchian.rb
Constant Summary
Constants inherited from Indicator
Constants included from Mixins::UniversalFilters
Instance Attribute Summary
Attributes inherited from Indicator
#p0, #p1, #p2, #p3, #series, #source, #t0, #t1, #t2, #t3
Instance Method Summary collapse
- #compute_bands ⇒ Object
- #lt_highs ⇒ Object
- #lt_lows ⇒ Object
- #lt_period ⇒ Object
- #mt_highs ⇒ Object
- #mt_lows ⇒ Object
- #mt_period ⇒ Object
- #st_highs ⇒ Object
- #st_lows ⇒ Object
- #st_period ⇒ Object
Methods inherited from Quant::Indicators::Pivot
#averaging_period, #band?, #compute, #compute_extents, #compute_midpoint, #compute_value, #period, #period_midpoints, #points_class
Methods inherited from Indicator
#<<, #[], #compute, #dc_period, dependent_indicator_classes, depends_on, #dominant_cycle, #dominant_cycle_indicator_class, #dominant_cycle_kind, #each, #half_period, #indicator_name, #initialize, #input, #inspect, #max_period, #micro_period, #min_period, #p, #period_points, #pivot_kind, #points_class, #priority, #size, #t, #ticks, #values
Methods included from Mixins::FisherTransform
#fisher_transform, #inverse_fisher_transform, #relative_fisher_transform
Methods included from Mixins::Stochastic
Methods included from Mixins::SuperSmoother
#three_pole_super_smooth, #two_pole_super_smooth
Methods included from Mixins::HilbertTransform
Methods included from Mixins::ExponentialMovingAverage
Methods included from Mixins::SimpleMovingAverage
Methods included from Mixins::WeightedMovingAverage
#extended_weighted_moving_average, #weighted_moving_average
Methods included from Mixins::UniversalFilters
#universal_band_pass, #universal_ema, #universal_filter, #universal_one_pole_high_pass, #universal_one_pole_low_pass, #universal_two_pole_high_pass, #universal_two_pole_low_pass
Methods included from Mixins::ButterworthFilters
#three_pole_butterworth, #two_pole_butterworth
Methods included from Mixins::HighPassFilters
#high_pass_filter, #hpf2, #two_pole_high_pass_filter
Methods included from Mixins::Functions
#angle, #bars_to_alpha, #deg2rad, #period_to_alpha, #rad2deg
Constructor Details
This class inherits a constructor from Quant::Indicators::Indicator
Instance Method Details
#compute_bands ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 20 def compute_bands st_highs << p0.high_price st_lows << p0.low_price mt_highs << p0.high_price mt_lows << p0.low_price lt_highs << p0.high_price lt_lows << p0.low_price p0.h1 = @st_highs.maximum p0.l1 = @st_lows.minimum p0.h2 = @mt_highs.maximum p0.l2 = @mt_lows.minimum p0.h3 = @lt_highs.maximum p0.l3 = @lt_lows.minimum end |
#lt_highs ⇒ Object
17 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 17 def lt_highs; @lt_highs ||= [].max_size!(lt_period) end |
#lt_lows ⇒ Object
18 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 18 def lt_lows; @lt_lows ||= [].max_size!(lt_period) end |
#lt_period ⇒ Object
11 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 11 def lt_period; max_period end |
#mt_highs ⇒ Object
15 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 15 def mt_highs; @mt_highs ||= [].max_size!(mt_period) end |
#mt_lows ⇒ Object
16 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 16 def mt_lows; @mt_lows ||= [].max_size!(mt_period) end |
#mt_period ⇒ Object
10 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 10 def mt_period; half_period end |
#st_highs ⇒ Object
13 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 13 def st_highs; @st_highs ||= [].max_size!(st_period) end |
#st_lows ⇒ Object
14 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 14 def st_lows; @st_lows ||= [].max_size!(st_period) end |
#st_period ⇒ Object
9 |
# File 'lib/quant/indicators/pivots/donchian.rb', line 9 def st_period; min_period end |