Class: Quant::Indicators::IndicatorPoint
- Inherits:
-
Object
- Object
- Quant::Indicators::IndicatorPoint
- Extended by:
- Forwardable
- Includes:
- Attributes
- Defined in:
- lib/quant/indicators/indicator_point.rb
Direct Known Subclasses
AdxPoint, AtrPoint, CciPoint, DecyclerPoint, DominantCycles::AcrPoint, DominantCycles::BandPassPoint, DominantCycles::DominantCyclePoint, DominantCycles::HalfPeriodPoint, EmaPoint, FramaPoint, MamaPoint, MesaPoint, PingPoint, Pivots::PivotPoint, RocketRsiPoint, RoofingPoint, RsiPoint, SnrPoint
Instance Attribute Summary collapse
-
#indicator ⇒ Object
readonly
Returns the value of attribute indicator.
-
#tick ⇒ Object
readonly
Returns the value of attribute tick.
Instance Method Summary collapse
-
#initialize(indicator:, tick:, source:) ⇒ IndicatorPoint
constructor
A new instance of IndicatorPoint.
- #initialize_data_points ⇒ Object
- #oc2 ⇒ Object
Methods included from Attributes
deregister, included, register, registry
Constructor Details
#initialize(indicator:, tick:, source:) ⇒ IndicatorPoint
Returns a new instance of IndicatorPoint.
14 15 16 17 18 19 20 |
# File 'lib/quant/indicators/indicator_point.rb', line 14 def initialize(indicator:, tick:, source:) @indicator = indicator @tick = tick @source = source @input = @tick.send(source) initialize_data_points end |
Instance Attribute Details
#indicator ⇒ Object (readonly)
Returns the value of attribute indicator.
9 10 11 |
# File 'lib/quant/indicators/indicator_point.rb', line 9 def indicator @indicator end |
#tick ⇒ Object (readonly)
Returns the value of attribute tick.
9 10 11 |
# File 'lib/quant/indicators/indicator_point.rb', line 9 def tick @tick end |
Instance Method Details
#initialize_data_points ⇒ Object
41 42 43 |
# File 'lib/quant/indicators/indicator_point.rb', line 41 def initialize_data_points # No-Op - Override in subclass if needed. end |
#oc2 ⇒ Object
37 38 39 |
# File 'lib/quant/indicators/indicator_point.rb', line 37 def oc2 tick.respond_to?(:oc2) ? tick.oc2 : tick.close_price end |