Class: IB::OutgoingMessages::RequestMarketData

Inherits:
AbstractMessage show all
Defined in:
lib/ib-ruby/messages.rb

Overview

Data format is { :ticker_id => int, :contract => Datatypes::Contract }

Instance Attribute Summary

Attributes inherited from ExtremelyAbstractMessage

#created_at

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractMessage

#initialize, #send

Methods inherited from ExtremelyAbstractMessage

#to_human

Constructor Details

This class inherits a constructor from IB::OutgoingMessages::AbstractMessage

Class Method Details

.message_idObject



100
101
102
# File 'lib/ib-ruby/messages.rb', line 100

def self.message_id
  1
end

Instance Method Details

#queue(server) ⇒ Object



104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/ib-ruby/messages.rb', line 104

def queue(server)
  queue = [ self.class.message_id,
            5, # message version number
            @data[:ticker_id]
          ].concat(@data[:contract].serialize_long(server[:version]))

  queue.concat(@data[:contract].serialize_combo_legs
               ) if server[:version] >= 8 && @data[:contract].sec_type == "BAG" # I have no idea what "BAG" means. Copied from the Java code.


  queue
end