Class: Dtn::Messages::Historical::Interval

Inherits:
MessageWithSimpleParser show all
Defined in:
lib/dtn/messages/historical/interval.rb

Overview

Bar representation

Class Method Summary collapse

Methods inherited from MessageWithSimpleParser

parse, #termination?

Methods inherited from Dtn::Message

#callback_name, callback_name, parse

Class Method Details

.fieldsObject

rubocop:disable Metrics/MethodLength



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dtn/messages/historical/interval.rb', line 10

def fields
  @fields ||= {
    request_id: :to_i,
    timestamp: :to_datetime,
    high: :to_f,
    low: :to_f,
    open: :to_f,
    close: :to_f,
    total_volume: :to_i,
    period_volume: :to_i,
    number_of_trades: :to_i
  }
end