Class: IbRubyProxy::Client::Ib::DeltaNeutralContract

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conid: 0, delta: 0, price: 0) ⇒ DeltaNeutralContract

Returns a new instance of DeltaNeutralContract.



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

def initialize(conid: 0, delta: 0, price: 0)
  self.conid = conid
  self.delta = delta
  self.price = price
end

Instance Attribute Details

#conidObject

Returns the value of attribute conid

Returns:

  • (Object)

    the current value of conid



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

def conid
  @conid
end

#deltaObject

Returns the value of attribute delta

Returns:

  • (Object)

    the current value of delta



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

def delta
  @delta
end

#priceObject

Returns the value of attribute price

Returns:

  • (Object)

    the current value of price



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

def price
  @price
end

Instance Method Details

#to_ibObject



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

def to_ib
  ib_object = Java::ComIbClient::DeltaNeutralContract.new
  ib_object.conid(conid).to_java
  ib_object.delta(delta).to_java
  ib_object.price(price).to_java

  ib_object
end