Class: IB::Messages::Outgoing::RequestHistoricalData
- Defined in:
- lib/ib/messages/outgoing/bar_requests.rb
Instance Method Summary collapse
Instance Method Details
#encode ⇒ Object
172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/ib/messages/outgoing/bar_requests.rb', line 172 def encode data_type, , contract = parse @data [super, contract.serialize_long(:include_expired), @data[:end_date_time], , @data[:duration], @data[:use_rth], data_type.to_s.upcase, @data[:format_date], contract.serialize_legs] end |
#parse(data) ⇒ Object
161 162 163 164 165 166 167 168 169 170 |
# File 'lib/ib/messages/outgoing/bar_requests.rb', line 161 def parse data data_type, , contract = super data size = data[:bar_size] || data[:size] = BAR_SIZES.invert[size] || size unless BAR_SIZES.keys.include?() error ":bar_size must be one of #{BAR_SIZES.inspect}", :args end [data_type, , contract] end |