Class: IB::Models::Bar

Inherits:
Model
  • Object
show all
Defined in:
lib/ib-ruby/models/bar.rb

Overview

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

Constant Summary

Constants inherited from Model

Model::DEFAULT_PROPS

Instance Attribute Summary

Attributes inherited from Model

#created_at

Instance Method Summary collapse

Methods inherited from Model

#[], #[]=, #initialize

Methods included from ModelProperties

#define_property, #define_property_methods, #prop

Constructor Details

This class inherits a constructor from IB::Models::Model

Instance Method Details

#to_sObject

int: When TRADES data history is returned, represents number of trades that occurred during the time period the bar covers



20
21
22
23
# File 'lib/ib-ruby/models/bar.rb', line 20

def to_s
  "<Bar #{time}: wap: #{wap}, OHLC: #{open}, #{high}, #{low}, #{close}, " +
      (trades ? "trades: #{trades}," : "") + " vol: #{volume}, gaps? #{has_gaps}>"
end