Class: IbRubyProxy::Client::Ib::HistoricalTick

Inherits:
Struct
  • Object
show all
Defined in:
lib/ib_ruby_proxy/client/ib/historical_tick.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time: nil, price: 0, size: nil) ⇒ HistoricalTick

Returns a new instance of HistoricalTick.



9
10
11
12
13
# File 'lib/ib_ruby_proxy/client/ib/historical_tick.rb', line 9

def initialize(time: nil, price: 0, size: nil)
  self.time = time
  self.price = price
  self.size = size
end

Instance Attribute Details

#priceObject

Returns the value of attribute price

Returns:

  • (Object)

    the current value of price



8
9
10
# File 'lib/ib_ruby_proxy/client/ib/historical_tick.rb', line 8

def price
  @price
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



8
9
10
# File 'lib/ib_ruby_proxy/client/ib/historical_tick.rb', line 8

def size
  @size
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



8
9
10
# File 'lib/ib_ruby_proxy/client/ib/historical_tick.rb', line 8

def time
  @time
end

Instance Method Details

#to_ibObject



15
16
17
18
19
20
21
22
# File 'lib/ib_ruby_proxy/client/ib/historical_tick.rb', line 15

def to_ib
  ib_object = Java::ComIbClient::HistoricalTick.new
  ib_object.time(time).to_java
  ib_object.price(price).to_java
  ib_object.size(size).to_java

  ib_object
end