Class: IB::Messages::Outgoing::RequestRealTimeBars
- Defined in:
- lib/ib/messages/outgoing/bar_requests.rb
Instance Method Summary collapse
Instance Method Details
#encode ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/ib/messages/outgoing/bar_requests.rb', line 57 def encode data_type, , contract = parse @data [super, contract.serialize_short(:primary_exchange), # include primary exchange in request , data_type.to_s.upcase, @data[:use_rth] , "" # not suported realtimebars option string ] end |
#parse(data) ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/ib/messages/outgoing/bar_requests.rb', line 49 def parse data data_type, , contract = super data size = data[:bar_size] || data[:size] = 5 # only 5 sec bars are supported --> for future use ::> size.to_i [data_type, , contract] end |