Class: IB::IncomingMessages::ExecutionData

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

Instance Attribute Summary collapse

Attributes inherited from AbstractMessage

#data

Attributes inherited from ExtremelyAbstractMessage

#created_at

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractMessage

inherited, #initialize

Methods inherited from ExtremelyAbstractMessage

#to_human

Constructor Details

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

Instance Attribute Details

#contractObject

Returns the value of attribute contract.



1246
1247
1248
# File 'lib/ib-ruby/messages.rb', line 1246

def contract
  @contract
end

#executionObject

Returns the value of attribute execution.



1246
1247
1248
# File 'lib/ib-ruby/messages.rb', line 1246

def execution
  @execution
end

Class Method Details

.message_idObject



1248
1249
1250
# File 'lib/ib-ruby/messages.rb', line 1248

def self.message_id
  11
end

Instance Method Details

#loadObject



1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
# File 'lib/ib-ruby/messages.rb', line 1252

def load
  @contract = Datatypes::Contract.new
  @execution = Datatypes::Execution.new

  autoload([:version, :int], [:order_id, :int])

  @contract.symbol = @socket.read_string
  @contract.sec_type = @socket.read_string
  @contract.expiry = @socket.read_string
  @contract.strike = @socket.read_decimal
  @contract.right = @socket.read_string
  @contract.currency = @socket.read_string
  @contract.local_symbol = @socket.read_string if @data[:version] >= 2

  @execution.order_id = @data[:order_id]
  @execution.exec_id = @socket.read_string
  @execution.time = @socket.read_string
  @execution. = @socket.read_string
  @execution.exchange = @socket.read_string
  @execution.side = @socket.read_string
  @execution.shares = @socket.read_int
  @execution.price = @socket.read_decimal

  @execution.perm_id = @socket.read_int if @data[:version] >= 2
  @execution.client_id = @socket.read_int if @data[:version] >= 3
  @execution.liquidation = @socket.read_int if @data[:version] >= 4
end