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.



60
61
62
# File 'lib/ib-ruby/datatypes.rb', line 60

def close
  @close
end

#dateObject

Returns the value of attribute date.



60
61
62
# File 'lib/ib-ruby/datatypes.rb', line 60

def date
  @date
end

#has_gapsObject

Returns the value of attribute has_gaps.



60
61
62
# File 'lib/ib-ruby/datatypes.rb', line 60

def has_gaps
  @has_gaps
end

#highObject

Returns the value of attribute high.



60
61
62
# File 'lib/ib-ruby/datatypes.rb', line 60

def high
  @high
end

#lowObject

Returns the value of attribute low.



60
61
62
# File 'lib/ib-ruby/datatypes.rb', line 60

def low
  @low
end

#openObject

Returns the value of attribute open.



60
61
62
# File 'lib/ib-ruby/datatypes.rb', line 60

def open
  @open
end

#volumeObject

Returns the value of attribute volume.



60
61
62
# File 'lib/ib-ruby/datatypes.rb', line 60

def volume
  @volume
end

#wapObject

Returns the value of attribute wap.



60
61
62
# File 'lib/ib-ruby/datatypes.rb', line 60

def wap
  @wap
end

Instance Method Details

#to_sObject



62
63
64
# File 'lib/ib-ruby/datatypes.rb', line 62

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