Class: Quant::Indicators::PivotPoint

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

Instance Attribute Summary

Attributes inherited from IndicatorPoint

#indicator, #tick

Instance Method Summary collapse

Methods inherited from IndicatorPoint

#initialize, #initialize_data_points

Methods included from Attributes

deregister, included, register, registry

Constructor Details

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

Instance Method Details

#[](band) ⇒ Object



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

def [](band)
  bands[band]
end

#[]=(band, value) ⇒ Object



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

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

#bandsObject



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

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

#key?(band) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#midpointObject Also known as: h0, l0



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

def midpoint
  bands[0]
end

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



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

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