Class: Quant::Indicators::Pivots::PivotPoint

Inherits:
IndicatorPoint show all
Defined in:
lib/quant/indicators/pivots/pivot.rb

Instance Attribute Summary

Attributes inherited from IndicatorPoint

#indicator, #tick

Instance Method Summary collapse

Methods inherited from IndicatorPoint

#initialize, #initialize_data_points, #oc2

Methods included from Attributes

deregister, included, register, registry

Constructor Details

This class inherits a constructor from Quant::Indicators::IndicatorPoint

Instance Method Details

#[](band) ⇒ Object



19
20
21
# File 'lib/quant/indicators/pivots/pivot.rb', line 19

def [](band)
  bands[band]
end

#[]=(band, value) ⇒ Object



23
24
25
# File 'lib/quant/indicators/pivots/pivot.rb', line 23

def []=(band, value)
  bands[band] = value
end

#bandsObject



15
16
17
# File 'lib/quant/indicators/pivots/pivot.rb', line 15

def bands
  @bands ||= { 0 => input }
end

#key?(band) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/quant/indicators/pivots/pivot.rb', line 27

def key?(band)
  bands.key?(band)
end

#midpointObject Also known as: h0, l0



31
32
33
# File 'lib/quant/indicators/pivots/pivot.rb', line 31

def midpoint
  bands[0]
end

#midpoint=(value) ⇒ Object Also known as: h0=, l0=



37
38
39
# File 'lib/quant/indicators/pivots/pivot.rb', line 37

def midpoint=(value)
  bands[0] = value
end