Class: IbRubyProxy::Client::Ib::Contract

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conid: 0, symbol: nil, sec_type: nil, last_trade_date_or_contract_month: nil, strike: 0, right: nil, multiplier: nil, exchange: nil, primary_exch: nil, currency: nil, local_symbol: nil, trading_class: nil, sec_id_type: nil, sec_id: nil, delta_neutral_contract: nil, include_expired: false, combo_legs_descrip: nil, combo_legs: nil) ⇒ Contract

Returns a new instance of Contract.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ib_ruby_proxy/client/ib/contract.rb', line 9

def initialize(conid: 0, symbol: nil, sec_type: nil, last_trade_date_or_contract_month: nil, strike: 0, right: nil, multiplier: nil, exchange: nil, primary_exch: nil, currency: nil, local_symbol: nil, trading_class: nil, sec_id_type: nil, sec_id: nil, delta_neutral_contract: nil, include_expired: false, combo_legs_descrip: nil, combo_legs: nil)
  self.conid = conid
  self.symbol = symbol
  self.sec_type = sec_type
  self.last_trade_date_or_contract_month = last_trade_date_or_contract_month
  self.strike = strike
  self.right = right
  self.multiplier = multiplier
  self.exchange = exchange
  self.primary_exch = primary_exch
  self.currency = currency
  self.local_symbol = local_symbol
  self.trading_class = trading_class
  self.sec_id_type = sec_id_type
  self.sec_id = sec_id
  self.delta_neutral_contract = delta_neutral_contract
  self.include_expired = include_expired
  self.combo_legs_descrip = combo_legs_descrip
  self.combo_legs = combo_legs
end

Instance Attribute Details

#combo_legsObject

Returns the value of attribute combo_legs

Returns:

  • (Object)

    the current value of combo_legs



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

def combo_legs
  @combo_legs
end

#combo_legs_descripObject

Returns the value of attribute combo_legs_descrip

Returns:

  • (Object)

    the current value of combo_legs_descrip



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

def combo_legs_descrip
  @combo_legs_descrip
end

#conidObject

Returns the value of attribute conid

Returns:

  • (Object)

    the current value of conid



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

def conid
  @conid
end

#currencyObject

Returns the value of attribute currency

Returns:

  • (Object)

    the current value of currency



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

def currency
  @currency
end

#delta_neutral_contractObject

Returns the value of attribute delta_neutral_contract

Returns:

  • (Object)

    the current value of delta_neutral_contract



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

def delta_neutral_contract
  @delta_neutral_contract
end

#exchangeObject

Returns the value of attribute exchange

Returns:

  • (Object)

    the current value of exchange



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

def exchange
  @exchange
end

#include_expiredObject

Returns the value of attribute include_expired

Returns:

  • (Object)

    the current value of include_expired



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

def include_expired
  @include_expired
end

#last_trade_date_or_contract_monthObject

Returns the value of attribute last_trade_date_or_contract_month

Returns:

  • (Object)

    the current value of last_trade_date_or_contract_month



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

def last_trade_date_or_contract_month
  @last_trade_date_or_contract_month
end

#local_symbolObject

Returns the value of attribute local_symbol

Returns:

  • (Object)

    the current value of local_symbol



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

def local_symbol
  @local_symbol
end

#multiplierObject

Returns the value of attribute multiplier

Returns:

  • (Object)

    the current value of multiplier



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

def multiplier
  @multiplier
end

#primary_exchObject

Returns the value of attribute primary_exch

Returns:

  • (Object)

    the current value of primary_exch



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

def primary_exch
  @primary_exch
end

#rightObject

Returns the value of attribute right

Returns:

  • (Object)

    the current value of right



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

def right
  @right
end

#sec_idObject

Returns the value of attribute sec_id

Returns:

  • (Object)

    the current value of sec_id



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

def sec_id
  @sec_id
end

#sec_id_typeObject

Returns the value of attribute sec_id_type

Returns:

  • (Object)

    the current value of sec_id_type



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

def sec_id_type
  @sec_id_type
end

#sec_typeObject

Returns the value of attribute sec_type

Returns:

  • (Object)

    the current value of sec_type



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

def sec_type
  @sec_type
end

#strikeObject

Returns the value of attribute strike

Returns:

  • (Object)

    the current value of strike



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

def strike
  @strike
end

#symbolObject

Returns the value of attribute symbol

Returns:

  • (Object)

    the current value of symbol



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

def symbol
  @symbol
end

#trading_classObject

Returns the value of attribute trading_class

Returns:

  • (Object)

    the current value of trading_class



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

def trading_class
  @trading_class
end

Instance Method Details

#to_ibObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/ib_ruby_proxy/client/ib/contract.rb', line 30

def to_ib
  ib_object = Java::ComIbClient::Contract.new
  ib_object.conid(conid).to_java
  ib_object.symbol(symbol).to_java
  ib_object.secType(sec_type).to_java
  ib_object.lastTradeDateOrContractMonth(last_trade_date_or_contract_month).to_java
  ib_object.strike(strike).to_java
  ib_object.right(right).to_java
  ib_object.multiplier(multiplier).to_java
  ib_object.exchange(exchange).to_java
  ib_object.primaryExch(primary_exch).to_java
  ib_object.currency(currency).to_java
  ib_object.localSymbol(local_symbol).to_java
  ib_object.tradingClass(trading_class).to_java
  ib_object.secIdType(sec_id_type).to_java
  ib_object.secId(sec_id).to_java
  ib_object.deltaNeutralContract(delta_neutral_contract).to_java
  ib_object.includeExpired(include_expired).to_java
  ib_object.comboLegsDescrip(combo_legs_descrip).to_java
  ib_object.comboLegs(combo_legs).to_java

  ib_object
end