Class: IB::OutgoingMessages::RequestMarketDepth

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

Overview

data = { :ticker_id => int, :contract => Contract, :num_rows => int }

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



368
369
370
# File 'lib/ib-ruby/messages.rb', line 368

def self.message_id
  10
end

Instance Method Details

#queue(server) ⇒ Object



372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/ib-ruby/messages.rb', line 372

def queue(server)
  requireVersion(server, 6)

  queue = [ self.class.message_id,
            3, # version
            @data[:ticker_id]
          ]
  queue.concat(@data[:contract].serialize_short(server[:version]))
  queue.push(@data[:num_rows]) if server[:version] >= 19

  queue

end