Class: Quant::Indicators::IndicatorPoint
- Inherits:
-
Object
- Object
- Quant::Indicators::IndicatorPoint
- Extended by:
- Forwardable
- Defined in:
- lib/quant/indicators/indicator_point.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#tick ⇒ Object
readonly
Returns the value of attribute tick.
Instance Method Summary collapse
-
#initialize(tick:, source:) ⇒ IndicatorPoint
constructor
A new instance of IndicatorPoint.
- #initialize_data_points(indicator:) ⇒ Object
- #timestamp ⇒ Object
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
- #volume ⇒ Object
Constructor Details
#initialize(tick:, source:) ⇒ IndicatorPoint
Returns a new instance of IndicatorPoint.
10 11 12 13 |
# File 'lib/quant/indicators/indicator_point.rb', line 10 def initialize(tick:, source:) @tick = tick @source = @tick.send(source) end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
8 9 10 |
# File 'lib/quant/indicators/indicator_point.rb', line 8 def source @source end |
#tick ⇒ Object (readonly)
Returns the value of attribute tick.
8 9 10 |
# File 'lib/quant/indicators/indicator_point.rb', line 8 def tick @tick end |
Instance Method Details
#initialize_data_points(indicator:) ⇒ Object
23 24 25 |
# File 'lib/quant/indicators/indicator_point.rb', line 23 def initialize_data_points(indicator:) # NoOp end |
#timestamp ⇒ Object
19 20 21 |
# File 'lib/quant/indicators/indicator_point.rb', line 19 def @tick. end |
#to_h ⇒ Object
27 28 29 |
# File 'lib/quant/indicators/indicator_point.rb', line 27 def to_h raise NotImplementedError end |
#to_json(*args) ⇒ Object
31 32 33 |
# File 'lib/quant/indicators/indicator_point.rb', line 31 def to_json(*args) Oj.dump(to_h, *args) end |
#volume ⇒ Object
15 16 17 |
# File 'lib/quant/indicators/indicator_point.rb', line 15 def volume @tick.base_volume end |