Class: IB::Bar

Inherits:
Model show all
Includes:
BaseProperties
Defined in:
lib/models/ib/bar.rb

Overview

This is a single data point delivered by HistoricData or RealTimeBar messages. Instantiate with a Hash of attributes, to be auto-set via initialize in Model.

Instance Method Summary collapse

Methods included from BaseProperties

#==, #as_table, #content_attributes, #default_attributes, #invariant_attributes, #set_attribute_defaults, #table_header, #table_row, #update_missing

Instance Method Details

#to_humanObject Also known as: to_s



24
25
26
27
# File 'lib/models/ib/bar.rb', line 24

def to_human
 "<Bar: #{time.strftime("(%d.%m.%y)%X")} wap #{wap.round(3)} OHLC #{open} #{high} #{low} #{close} " +
    (trades ? "trades #{trades}" : "") + " vol #{volume}>"
end