Class: TechnicalAnalysis::Adx::AdxValue
- Inherits:
-
Object
- Object
- TechnicalAnalysis::Adx::AdxValue
- Defined in:
- lib/technical_analysis/indicators/adx.rb
Overview
The value class to be returned by calculations
Instance Attribute Summary collapse
-
#adx ⇒ Float
The adx calculation value.
-
#date_time ⇒ String
The date_time of the obversation as it was provided.
-
#di_neg ⇒ Float
The negative directional indicator calculation value.
-
#di_pos ⇒ Float
The positive directional indicator calculation value.
Instance Method Summary collapse
-
#initialize(date_time: nil, adx: nil, di_pos: nil, di_neg: nil) ⇒ AdxValue
constructor
A new instance of AdxValue.
-
#to_hash ⇒ Hash
The attributes as a hash.
Constructor Details
#initialize(date_time: nil, adx: nil, di_pos: nil, di_neg: nil) ⇒ AdxValue
Returns a new instance of AdxValue.
153 154 155 156 157 158 |
# File 'lib/technical_analysis/indicators/adx.rb', line 153 def initialize(date_time: nil, adx: nil, di_pos: nil, di_neg: nil) @date_time = date_time @adx = adx @di_pos = di_pos @di_neg = di_neg end |
Instance Attribute Details
#adx ⇒ Float
Returns the adx calculation value.
145 146 147 |
# File 'lib/technical_analysis/indicators/adx.rb', line 145 def adx @adx end |
#date_time ⇒ String
Returns the date_time of the obversation as it was provided.
142 143 144 |
# File 'lib/technical_analysis/indicators/adx.rb', line 142 def date_time @date_time end |
#di_neg ⇒ Float
Returns the negative directional indicator calculation value.
151 152 153 |
# File 'lib/technical_analysis/indicators/adx.rb', line 151 def di_neg @di_neg end |
#di_pos ⇒ Float
Returns the positive directional indicator calculation value.
148 149 150 |
# File 'lib/technical_analysis/indicators/adx.rb', line 148 def di_pos @di_pos end |
Instance Method Details
#to_hash ⇒ Hash
Returns the attributes as a hash.
161 162 163 |
# File 'lib/technical_analysis/indicators/adx.rb', line 161 def to_hash { date_time: @date_time, adx: @adx, di_pos: @di_pos, di_neg: @di_neg } end |