Sha256: 0be285be6b92c23aa47b7aa807c89d562c53e02ad0a135573e41c6b9338929c0

Contents?: true

Size: 1.32 KB

Versions: 14

Compression:

Stored size: 1.32 KB

Contents

require 'ib-ruby/models/model'

module IB
  module Models
    # This is a single data point delivered by HistoricData messages.
    # Instantiate with a Hash of attributes, to be auto-set via initialize in Model.
    class Bar < Model
      attr_accessor :date, # The date-time stamp of the start of the bar. The format is
                    #        determined by the reqHistoricalData() formatDate parameter.
                    :open, #   The bar opening price.
                    :high, #   The high price during the time covered by the bar.
                    :low, #    The low price during the time covered by the bar.
                    :close, #  The bar closing price.
                    :volume, # The bar opening price.
                    :wap, #    Weighted average price during the time covered by the bar.
                    :has_gaps, # Whether or not there are gaps in the data.
                    :trades # int: When TRADES data history is returned, represents number
                            # of trades that occurred during the time period the bar covers

      def to_s
        "<Bar #{@date}: wap: #{@wap}, OHLC: #{@open}, #{@high}, #{@low}, #{@close}, " +
            (@trades ? "trades: #{@trades}," : "") + " vol: #{@volume}, gaps? #{@has_gaps}>"
      end
    end # class Bar
  end # module Models
end # module IB

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ib-ruby-0.5.19 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.18 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.17 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.16 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.15 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.14 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.13 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.12 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.11 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.10 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.9 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.7 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.2 lib/ib-ruby/models/bar.rb
ib-ruby-0.5.0 lib/ib-ruby/models/bar.rb