Class: TechnicalAnalysis::IchimokuValue

Inherits:
Object
  • Object
show all
Defined in:
lib/technical_analysis/indicators/ichimoku.rb

Overview

The value class to be returned by calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_time: nil, tenkan_sen: nil, kijun_sen: nil, senkou_span_a: nil, senkou_span_b: nil, chikou_span: nil) ⇒ IchimokuValue

Returns a new instance of IchimokuValue.



157
158
159
160
161
162
163
164
# File 'lib/technical_analysis/indicators/ichimoku.rb', line 157

def initialize(date_time: nil, tenkan_sen: nil, kijun_sen: nil, senkou_span_a: nil, senkou_span_b: nil, chikou_span: nil)
  @date_time = date_time
  @tenkan_sen = tenkan_sen
  @kijun_sen = kijun_sen
  @senkou_span_a = senkou_span_a
  @senkou_span_b = senkou_span_b
  @chikou_span = chikou_span
end

Instance Attribute Details

#chikou_spanFloat

Returns the chikou_span calculation value.

Returns:

  • (Float)

    the chikou_span calculation value



155
156
157
# File 'lib/technical_analysis/indicators/ichimoku.rb', line 155

def chikou_span
  @chikou_span
end

#date_timeString

Returns the date_time of the obversation as it was provided.

Returns:

  • (String)

    the date_time of the obversation as it was provided



140
141
142
# File 'lib/technical_analysis/indicators/ichimoku.rb', line 140

def date_time
  @date_time
end

#kijun_senFloat

Returns the kijun_sen calculation value.

Returns:

  • (Float)

    the kijun_sen calculation value



146
147
148
# File 'lib/technical_analysis/indicators/ichimoku.rb', line 146

def kijun_sen
  @kijun_sen
end

#senkou_span_aFloat

Returns the senkou_span_a calculation value.

Returns:

  • (Float)

    the senkou_span_a calculation value



149
150
151
# File 'lib/technical_analysis/indicators/ichimoku.rb', line 149

def senkou_span_a
  @senkou_span_a
end

#senkou_span_bFloat

Returns the senkou_span_b calculation value.

Returns:

  • (Float)

    the senkou_span_b calculation value



152
153
154
# File 'lib/technical_analysis/indicators/ichimoku.rb', line 152

def senkou_span_b
  @senkou_span_b
end

#tenkan_senFloat

Returns the tenkan_sen calculation value.

Returns:

  • (Float)

    the tenkan_sen calculation value



143
144
145
# File 'lib/technical_analysis/indicators/ichimoku.rb', line 143

def tenkan_sen
  @tenkan_sen
end

Instance Method Details

#to_hashHash

Returns the attributes as a hash.

Returns:

  • (Hash)

    the attributes as a hash



167
168
169
170
171
172
173
174
175
176
# File 'lib/technical_analysis/indicators/ichimoku.rb', line 167

def to_hash
  {
    date_time: @date_time,
    tenkan_sen: @tenkan_sen,
    kijun_sen: @kijun_sen,
    senkou_span_a: @senkou_span_a,
    senkou_span_b: @senkou_span_b,
    chikou_span: @chikou_span
  }
end