Class: IB::Messages::Outgoing::RequestRealTimeBars

Inherits:
Object
  • Object
show all
Defined in:
lib/ib/messages/outgoing/bar_requests.rb

Instance Method Summary collapse

Instance Method Details

#encodeObject



55
56
57
58
59
60
61
62
63
# File 'lib/ib/messages/outgoing/bar_requests.rb', line 55

def encode
  data_type, bar_size, contract = parse @data

  [super,
   contract.serialize_long,
   bar_size,
   data_type.to_s.upcase,
   @data[:use_rth]]
end

#parse(data) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/ib/messages/outgoing/bar_requests.rb', line 47

def parse data
  data_type, bar_size, contract = super data

  size = data[:bar_size] || data[:size]
  bar_size = size.to_i
  [data_type, bar_size, contract]
end