Class: IbRubyProxy::Client::Ib::Bar

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time: nil, open: 0, high: 0, low: 0, close: 0, volume: nil, count: 0, wap: 0) ⇒ Bar

Returns a new instance of Bar.



9
10
11
12
13
14
15
16
17
18
# File 'lib/ib_ruby_proxy/client/ib/bar.rb', line 9

def initialize(time: nil, open: 0, high: 0, low: 0, close: 0, volume: nil, count: 0, wap: 0)
  self.time = time
  self.open = open
  self.high = high
  self.low = low
  self.close = close
  self.volume = volume
  self.count = count
  self.wap = wap
end

Instance Attribute Details

#closeObject

Returns the value of attribute close

Returns:

  • (Object)

    the current value of close



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

def close
  @close
end

#countObject

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



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

def count
  @count
end

#highObject

Returns the value of attribute high

Returns:

  • (Object)

    the current value of high



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

def high
  @high
end

#lowObject

Returns the value of attribute low

Returns:

  • (Object)

    the current value of low



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

def low
  @low
end

#openObject

Returns the value of attribute open

Returns:

  • (Object)

    the current value of open



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

def open
  @open
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/bar.rb', line 8

def time
  @time
end

#volumeObject

Returns the value of attribute volume

Returns:

  • (Object)

    the current value of volume



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

def volume
  @volume
end

#wapObject

Returns the value of attribute wap

Returns:

  • (Object)

    the current value of wap



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

def wap
  @wap
end

Instance Method Details

#to_ibObject



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ib_ruby_proxy/client/ib/bar.rb', line 20

def to_ib
  ib_object = Java::ComIbClient::Bar.new
  ib_object.time(time).to_java
  ib_object.open(open).to_java
  ib_object.high(high).to_java
  ib_object.low(low).to_java
  ib_object.close(close).to_java
  ib_object.volume(volume).to_java
  ib_object.count(count).to_java
  ib_object.wap(wap).to_java

  ib_object
end