Class: IB::Datatypes::Bar

Inherits:
AbstractDatum show all
Defined in:
lib/ib-ruby/datatypes.rb

Overview

This is used within HistoricData messages. Instantiate with a Hash of attributes, to be auto-set via initialize in AbstractDatum.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractDatum

#init, #initialize

Constructor Details

This class inherits a constructor from IB::Datatypes::AbstractDatum

Instance Attribute Details

#closeObject

Returns the value of attribute close.



56
57
58
# File 'lib/ib-ruby/datatypes.rb', line 56

def close
  @close
end

#dateObject

Returns the value of attribute date.



56
57
58
# File 'lib/ib-ruby/datatypes.rb', line 56

def date
  @date
end

#has_gapsObject

Returns the value of attribute has_gaps.



56
57
58
# File 'lib/ib-ruby/datatypes.rb', line 56

def has_gaps
  @has_gaps
end

#highObject

Returns the value of attribute high.



56
57
58
# File 'lib/ib-ruby/datatypes.rb', line 56

def high
  @high
end

#lowObject

Returns the value of attribute low.



56
57
58
# File 'lib/ib-ruby/datatypes.rb', line 56

def low
  @low
end

#openObject

Returns the value of attribute open.



56
57
58
# File 'lib/ib-ruby/datatypes.rb', line 56

def open
  @open
end

#volumeObject

Returns the value of attribute volume.



56
57
58
# File 'lib/ib-ruby/datatypes.rb', line 56

def volume
  @volume
end

#wapObject

Returns the value of attribute wap.



56
57
58
# File 'lib/ib-ruby/datatypes.rb', line 56

def wap
  @wap
end

Instance Method Details

#to_sObject



58
59
60
# File 'lib/ib-ruby/datatypes.rb', line 58

def to_s
  "<Bar: #{@date}; OHLC: #{@open.to_digits}, #{@high.to_digits}, #{@low.to_digits}, #{@close.to_digits}; volume: #{@volume}; wap: #{@wap.to_digits}; has_gaps: #{@has_gaps}>"
end