Sha256: ed4c5ccacea15e86fd77903bce87d4fd63933d5084f89dbeca5e21026782840b

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

module IB
  module Messages
    module Incoming

      # RealTimeBar contains following @data:
      #    :request_id - The ID of the *request* to which this is responding
      #    :time - The date-time stamp of the start of the bar. The format is offset in
      #            seconds from the beginning of 1970, same format as the UNIX epoch time
      #    :bar - received RT Bar
      RealTimeBar = def_message [50, 3],
                                [:request_id, :int],
                                [:bar, :time, :int],
                                [:bar, :open, :decimal],
                                [:bar, :high, :decimal],
                                [:bar, :low, :decimal],
                                [:bar, :close, :decimal],
                                [:bar, :volume, :int],
                                [:bar, :wap, :decimal],
                                [:bar, :trades, :int]
      class RealTimeBar
        def bar
          @bar = IB::Bar.new @data[:bar]
        end

        def to_human
          "<RealTimeBar: #{request_id} #{bar}>"
        end
      end # RealTimeBar

    end # module Incoming
  end # module Messages
end # module IB

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
my-ib-api-0.0.4 lib/ib/messages/incoming/real_time_bar.rb
my-ib-api-0.0.3 lib/ib/messages/incoming/real_time_bar.rb
my-ib-api-0.0.2 lib/ib/messages/incoming/real_time_bar.rb
my-ib-api-0.0.1 lib/ib/messages/incoming/real_time_bar.rb
ib-ruby-0.9.2 lib/ib/messages/incoming/real_time_bar.rb