Class: Quant::Indicators::MaPoint

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

Instance Attribute Summary collapse

Attributes inherited from IndicatorPoint

#source, #tick

Instance Method Summary collapse

Methods inherited from IndicatorPoint

#initialize, #timestamp, #to_json, #volume

Constructor Details

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

Instance Attribute Details

#emaObject

Returns the value of attribute ema.



4
5
6
# File 'lib/quant/indicators/ma.rb', line 4

def ema
  @ema
end

#oscObject

Returns the value of attribute osc.



4
5
6
# File 'lib/quant/indicators/ma.rb', line 4

def osc
  @osc
end

#ssObject

Returns the value of attribute ss.



4
5
6
# File 'lib/quant/indicators/ma.rb', line 4

def ss
  @ss
end

Instance Method Details

#initialize_data_points(indicator:) ⇒ Object



14
15
16
17
18
# File 'lib/quant/indicators/ma.rb', line 14

def initialize_data_points(indicator:)
  @ss = oc2
  @ema = oc2
  @osc = nil
end

#to_hObject



6
7
8
9
10
11
12
# File 'lib/quant/indicators/ma.rb', line 6

def to_h
  {
    "ss" => ss,
    "ema" => delta_phase,
    "osc" => osc
  }
end