Class: IbRubyProxy::Client::Ib::HistoricalTickBidAsk

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time: nil, tick_attrib_bid_ask: nil, price_bid: 0, price_ask: 0, size_bid: nil, size_ask: nil) ⇒ HistoricalTickBidAsk

Returns a new instance of HistoricalTickBidAsk.



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

def initialize(time: nil, tick_attrib_bid_ask: nil, price_bid: 0, price_ask: 0, size_bid: nil, size_ask: nil)
  self.time = time
  self.tick_attrib_bid_ask = tick_attrib_bid_ask
  self.price_bid = price_bid
  self.price_ask = price_ask
  self.size_bid = size_bid
  self.size_ask = size_ask
end

Instance Attribute Details

#price_askObject

Returns the value of attribute price_ask

Returns:

  • (Object)

    the current value of price_ask



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

def price_ask
  @price_ask
end

#price_bidObject

Returns the value of attribute price_bid

Returns:

  • (Object)

    the current value of price_bid



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

def price_bid
  @price_bid
end

#size_askObject

Returns the value of attribute size_ask

Returns:

  • (Object)

    the current value of size_ask



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

def size_ask
  @size_ask
end

#size_bidObject

Returns the value of attribute size_bid

Returns:

  • (Object)

    the current value of size_bid



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

def size_bid
  @size_bid
end

#tick_attrib_bid_askObject

Returns the value of attribute tick_attrib_bid_ask

Returns:

  • (Object)

    the current value of tick_attrib_bid_ask



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

def tick_attrib_bid_ask
  @tick_attrib_bid_ask
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_bid_ask.rb', line 8

def time
  @time
end

Instance Method Details

#to_ibObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ib_ruby_proxy/client/ib/historical_tick_bid_ask.rb', line 18

def to_ib
  ib_object = Java::ComIbClient::HistoricalTickBidAsk.new
  ib_object.time(time).to_java
  ib_object.tickAttribBidAsk(tick_attrib_bid_ask).to_java
  ib_object.priceBid(price_bid).to_java
  ib_object.priceAsk(price_ask).to_java
  ib_object.sizeBid(size_bid).to_java
  ib_object.sizeAsk(size_ask).to_java

  ib_object
end