Class: Quant::Indicators::Pivots::Fibbonacci
- Defined in:
- lib/quant/indicators/pivots/fibbonacci.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
Methods inherited from Pivot
#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, register, #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
#averaging_period ⇒ Object
7 8 9 |
# File 'lib/quant/indicators/pivots/fibbonacci.rb', line 7 def averaging_period half_period end |
#compute_bands ⇒ Object
15 16 17 18 19 20 |
# File 'lib/quant/indicators/pivots/fibbonacci.rb', line 15 def compute_bands fibbonacci_series.each_with_index do |ratio, index| p0[index + 1] = p0.midpoint + ratio * p0.avg_range p0[-index - 1] = p0.midpoint - ratio * p0.avg_range end end |
#fibbonacci_series ⇒ Object
11 12 13 |
# File 'lib/quant/indicators/pivots/fibbonacci.rb', line 11 def fibbonacci_series [0.146, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0, 1.146] end |