ib_ruby_proxy 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +77 -0
  3. data/.gitignore +8 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +143 -0
  6. data/.ruby-version +1 -0
  7. data/.travis.yml +7 -0
  8. data/Gemfile +10 -0
  9. data/Gemfile.lock +74 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +130 -0
  12. data/Rakefile +12 -0
  13. data/bin/console +14 -0
  14. data/bin/generate_ruby_classes +13 -0
  15. data/bin/ibproxy +32 -0
  16. data/bin/setup +8 -0
  17. data/docs/diagrams.key +0 -0
  18. data/docs/images/architecture.png +0 -0
  19. data/examples/common.rb +14 -0
  20. data/examples/plain_req_historical_ticks.rb +19 -0
  21. data/examples/req_contract_details.rb +9 -0
  22. data/examples/req_historical_bars_data.rb +10 -0
  23. data/examples/req_historical_ticks.rb +10 -0
  24. data/examples/req_tick_by_tick_data.rb +9 -0
  25. data/ib_ruby_proxy.gemspec +43 -0
  26. data/lib/ib_ruby_proxy.rb +35 -0
  27. data/lib/ib_ruby_proxy/client/callbacks_response_handler.rb +135 -0
  28. data/lib/ib_ruby_proxy/client/client.rb +69 -0
  29. data/lib/ib_ruby_proxy/client/ib/bar.rb +36 -0
  30. data/lib/ib_ruby_proxy/client/ib/combo_leg.rb +36 -0
  31. data/lib/ib_ruby_proxy/client/ib/contract.rb +56 -0
  32. data/lib/ib_ruby_proxy/client/ib/contract_details.rb +100 -0
  33. data/lib/ib_ruby_proxy/client/ib/delta_neutral_contract.rb +26 -0
  34. data/lib/ib_ruby_proxy/client/ib/historical_tick.rb +26 -0
  35. data/lib/ib_ruby_proxy/client/ib/historical_tick_bid_ask.rb +32 -0
  36. data/lib/ib_ruby_proxy/client/ib/historical_tick_last.rb +32 -0
  37. data/lib/ib_ruby_proxy/client/ib/order.rb +262 -0
  38. data/lib/ib_ruby_proxy/client/ib/tick_attrib_bid_ask.rb +24 -0
  39. data/lib/ib_ruby_proxy/client/ib/tick_attrib_last.rb +24 -0
  40. data/lib/ib_ruby_proxy/client/ib_callbacks_observer.rb +25 -0
  41. data/lib/ib_ruby_proxy/config.yml +43 -0
  42. data/lib/ib_ruby_proxy/server/ext/array.rb +22 -0
  43. data/lib/ib_ruby_proxy/server/ext/enum.rb +20 -0
  44. data/lib/ib_ruby_proxy/server/ext/idempotent_types.rb +23 -0
  45. data/lib/ib_ruby_proxy/server/ib/bar.rb +21 -0
  46. data/lib/ib_ruby_proxy/server/ib/combo_leg.rb +21 -0
  47. data/lib/ib_ruby_proxy/server/ib/contract.rb +31 -0
  48. data/lib/ib_ruby_proxy/server/ib/contract_details.rb +53 -0
  49. data/lib/ib_ruby_proxy/server/ib/delta_neutral_contract.rb +16 -0
  50. data/lib/ib_ruby_proxy/server/ib/historical_tick.rb +16 -0
  51. data/lib/ib_ruby_proxy/server/ib/historical_tick_bid_ask.rb +19 -0
  52. data/lib/ib_ruby_proxy/server/ib/historical_tick_last.rb +19 -0
  53. data/lib/ib_ruby_proxy/server/ib/order.rb +134 -0
  54. data/lib/ib_ruby_proxy/server/ib/tick_attrib_bid_ask.rb +15 -0
  55. data/lib/ib_ruby_proxy/server/ib/tick_attrib_last.rb +15 -0
  56. data/lib/ib_ruby_proxy/server/ib_client_adapter.rb +51 -0
  57. data/lib/ib_ruby_proxy/server/ib_proxy_service.rb +85 -0
  58. data/lib/ib_ruby_proxy/server/ib_ruby_class_files_generator.rb +77 -0
  59. data/lib/ib_ruby_proxy/server/ib_ruby_class_source_generator.rb +155 -0
  60. data/lib/ib_ruby_proxy/server/ib_wrapper_adapter.rb +47 -0
  61. data/lib/ib_ruby_proxy/server/reflection/ib_class.rb +62 -0
  62. data/lib/ib_ruby_proxy/server/reflection/ib_field.rb +60 -0
  63. data/lib/ib_ruby_proxy/util/has_logger.rb +10 -0
  64. data/lib/ib_ruby_proxy/util/string_utils.rb +29 -0
  65. data/lib/ib_ruby_proxy/version.rb +3 -0
  66. data/lib/server.rb +4 -0
  67. data/sandbox/drb_performance/client.rb +46 -0
  68. data/sandbox/drb_performance/server.rb +26 -0
  69. data/vendor/TwsApi.jar +0 -0
  70. metadata +226 -0
@@ -0,0 +1,36 @@
1
+ # ---------------------------------------------
2
+ # File generated automatically by ib_ruby_proxy
3
+ # ---------------------------------------------
4
+
5
+ module IbRubyProxy
6
+ module Client
7
+ module Ib
8
+ Bar = Struct.new(:time, :open, :high, :low, :close, :volume, :count, :wap, keyword_init: true) do
9
+ def initialize(time: nil, open: 0, high: 0, low: 0, close: 0, volume: nil, count: 0, wap: 0)
10
+ self.time = time
11
+ self.open = open
12
+ self.high = high
13
+ self.low = low
14
+ self.close = close
15
+ self.volume = volume
16
+ self.count = count
17
+ self.wap = wap
18
+ end
19
+
20
+ def to_ib
21
+ ib_object = Java::ComIbClient::Bar.new
22
+ ib_object.time(time).to_java
23
+ ib_object.open(open).to_java
24
+ ib_object.high(high).to_java
25
+ ib_object.low(low).to_java
26
+ ib_object.close(close).to_java
27
+ ib_object.volume(volume).to_java
28
+ ib_object.count(count).to_java
29
+ ib_object.wap(wap).to_java
30
+
31
+ ib_object
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ # ---------------------------------------------
2
+ # File generated automatically by ib_ruby_proxy
3
+ # ---------------------------------------------
4
+
5
+ module IbRubyProxy
6
+ module Client
7
+ module Ib
8
+ ComboLeg = Struct.new(:conid, :ratio, :action, :exchange, :open_close, :short_sale_slot, :designated_location, :exempt_code, keyword_init: true) do
9
+ def initialize(conid: 0, ratio: 0, action: nil, exchange: nil, open_close: 0, short_sale_slot: 0, designated_location: nil, exempt_code: 0)
10
+ self.conid = conid
11
+ self.ratio = ratio
12
+ self.action = action
13
+ self.exchange = exchange
14
+ self.open_close = open_close
15
+ self.short_sale_slot = short_sale_slot
16
+ self.designated_location = designated_location
17
+ self.exempt_code = exempt_code
18
+ end
19
+
20
+ def to_ib
21
+ ib_object = Java::ComIbClient::ComboLeg.new
22
+ ib_object.conid(conid).to_java
23
+ ib_object.ratio(ratio).to_java
24
+ ib_object.action(action).to_java
25
+ ib_object.exchange(exchange).to_java
26
+ ib_object.openClose(open_close).to_java
27
+ ib_object.shortSaleSlot(short_sale_slot).to_java
28
+ ib_object.designatedLocation(designated_location).to_java
29
+ ib_object.exemptCode(exempt_code).to_java
30
+
31
+ ib_object
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,56 @@
1
+ # ---------------------------------------------
2
+ # File generated automatically by ib_ruby_proxy
3
+ # ---------------------------------------------
4
+
5
+ module IbRubyProxy
6
+ module Client
7
+ module Ib
8
+ Contract = Struct.new(:conid, :symbol, :sec_type, :last_trade_date_or_contract_month, :strike, :right, :multiplier, :exchange, :primary_exch, :currency, :local_symbol, :trading_class, :sec_id_type, :sec_id, :delta_neutral_contract, :include_expired, :combo_legs_descrip, :combo_legs, keyword_init: true) do
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)
10
+ self.conid = conid
11
+ self.symbol = symbol
12
+ self.sec_type = sec_type
13
+ self.last_trade_date_or_contract_month = last_trade_date_or_contract_month
14
+ self.strike = strike
15
+ self.right = right
16
+ self.multiplier = multiplier
17
+ self.exchange = exchange
18
+ self.primary_exch = primary_exch
19
+ self.currency = currency
20
+ self.local_symbol = local_symbol
21
+ self.trading_class = trading_class
22
+ self.sec_id_type = sec_id_type
23
+ self.sec_id = sec_id
24
+ self.delta_neutral_contract = delta_neutral_contract
25
+ self.include_expired = include_expired
26
+ self.combo_legs_descrip = combo_legs_descrip
27
+ self.combo_legs = combo_legs
28
+ end
29
+
30
+ def to_ib
31
+ ib_object = Java::ComIbClient::Contract.new
32
+ ib_object.conid(conid).to_java
33
+ ib_object.symbol(symbol).to_java
34
+ ib_object.secType(sec_type).to_java
35
+ ib_object.lastTradeDateOrContractMonth(last_trade_date_or_contract_month).to_java
36
+ ib_object.strike(strike).to_java
37
+ ib_object.right(right).to_java
38
+ ib_object.multiplier(multiplier).to_java
39
+ ib_object.exchange(exchange).to_java
40
+ ib_object.primaryExch(primary_exch).to_java
41
+ ib_object.currency(currency).to_java
42
+ ib_object.localSymbol(local_symbol).to_java
43
+ ib_object.tradingClass(trading_class).to_java
44
+ ib_object.secIdType(sec_id_type).to_java
45
+ ib_object.secId(sec_id).to_java
46
+ ib_object.deltaNeutralContract(delta_neutral_contract).to_java
47
+ ib_object.includeExpired(include_expired).to_java
48
+ ib_object.comboLegsDescrip(combo_legs_descrip).to_java
49
+ ib_object.comboLegs(combo_legs).to_java
50
+
51
+ ib_object
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,100 @@
1
+ # ---------------------------------------------
2
+ # File generated automatically by ib_ruby_proxy
3
+ # ---------------------------------------------
4
+
5
+ module IbRubyProxy
6
+ module Client
7
+ module Ib
8
+ ContractDetails = Struct.new(:contract, :market_name, :min_tick, :price_magnifier, :order_types, :valid_exchanges, :under_conid, :long_name, :contract_month, :industry, :category, :subcategory, :time_zone_id, :trading_hours, :liquid_hours, :ev_rule, :ev_multiplier, :md_size_multiplier, :sec_id_list, :agg_group, :under_symbol, :under_sec_type, :market_rule_ids, :real_expiration_date, :last_trade_time, :cusip, :ratings, :desc_append, :bond_type, :coupon_type, :callable, :putable, :coupon, :convertible, :maturity, :issue_date, :next_option_date, :next_option_type, :next_option_partial, :notes, keyword_init: true) do
9
+ def initialize(contract: nil, market_name: nil, min_tick: 0, price_magnifier: 0, order_types: nil, valid_exchanges: nil, under_conid: 0, long_name: nil, contract_month: nil, industry: nil, category: nil, subcategory: nil, time_zone_id: nil, trading_hours: nil, liquid_hours: nil, ev_rule: nil, ev_multiplier: 0, md_size_multiplier: 0, sec_id_list: nil, agg_group: 0, under_symbol: nil, under_sec_type: nil, market_rule_ids: nil, real_expiration_date: nil, last_trade_time: nil, cusip: nil, ratings: nil, desc_append: nil, bond_type: nil, coupon_type: nil, callable: false, putable: false, coupon: 0, convertible: false, maturity: nil, issue_date: nil, next_option_date: nil, next_option_type: nil, next_option_partial: false, notes: nil)
10
+ self.contract = contract
11
+ self.market_name = market_name
12
+ self.min_tick = min_tick
13
+ self.price_magnifier = price_magnifier
14
+ self.order_types = order_types
15
+ self.valid_exchanges = valid_exchanges
16
+ self.under_conid = under_conid
17
+ self.long_name = long_name
18
+ self.contract_month = contract_month
19
+ self.industry = industry
20
+ self.category = category
21
+ self.subcategory = subcategory
22
+ self.time_zone_id = time_zone_id
23
+ self.trading_hours = trading_hours
24
+ self.liquid_hours = liquid_hours
25
+ self.ev_rule = ev_rule
26
+ self.ev_multiplier = ev_multiplier
27
+ self.md_size_multiplier = md_size_multiplier
28
+ self.sec_id_list = sec_id_list
29
+ self.agg_group = agg_group
30
+ self.under_symbol = under_symbol
31
+ self.under_sec_type = under_sec_type
32
+ self.market_rule_ids = market_rule_ids
33
+ self.real_expiration_date = real_expiration_date
34
+ self.last_trade_time = last_trade_time
35
+ self.cusip = cusip
36
+ self.ratings = ratings
37
+ self.desc_append = desc_append
38
+ self.bond_type = bond_type
39
+ self.coupon_type = coupon_type
40
+ self.callable = callable
41
+ self.putable = putable
42
+ self.coupon = coupon
43
+ self.convertible = convertible
44
+ self.maturity = maturity
45
+ self.issue_date = issue_date
46
+ self.next_option_date = next_option_date
47
+ self.next_option_type = next_option_type
48
+ self.next_option_partial = next_option_partial
49
+ self.notes = notes
50
+ end
51
+
52
+ def to_ib
53
+ ib_object = Java::ComIbClient::ContractDetails.new
54
+ ib_object.contract(contract).to_java
55
+ ib_object.marketName(market_name).to_java
56
+ ib_object.minTick(min_tick).to_java
57
+ ib_object.priceMagnifier(price_magnifier).to_java
58
+ ib_object.orderTypes(order_types).to_java
59
+ ib_object.validExchanges(valid_exchanges).to_java
60
+ ib_object.underConid(under_conid).to_java
61
+ ib_object.longName(long_name).to_java
62
+ ib_object.contractMonth(contract_month).to_java
63
+ ib_object.industry(industry).to_java
64
+ ib_object.category(category).to_java
65
+ ib_object.subcategory(subcategory).to_java
66
+ ib_object.timeZoneId(time_zone_id).to_java
67
+ ib_object.tradingHours(trading_hours).to_java
68
+ ib_object.liquidHours(liquid_hours).to_java
69
+ ib_object.evRule(ev_rule).to_java
70
+ ib_object.evMultiplier(ev_multiplier).to_java
71
+ ib_object.mdSizeMultiplier(md_size_multiplier).to_java
72
+ ib_object.secIdList(sec_id_list).to_java
73
+ ib_object.aggGroup(agg_group).to_java
74
+ ib_object.underSymbol(under_symbol).to_java
75
+ ib_object.underSecType(under_sec_type).to_java
76
+ ib_object.marketRuleIds(market_rule_ids).to_java
77
+ ib_object.realExpirationDate(real_expiration_date).to_java
78
+ ib_object.lastTradeTime(last_trade_time).to_java
79
+ ib_object.cusip(cusip).to_java
80
+ ib_object.ratings(ratings).to_java
81
+ ib_object.descAppend(desc_append).to_java
82
+ ib_object.bondType(bond_type).to_java
83
+ ib_object.couponType(coupon_type).to_java
84
+ ib_object.callable(callable).to_java
85
+ ib_object.putable(putable).to_java
86
+ ib_object.coupon(coupon).to_java
87
+ ib_object.convertible(convertible).to_java
88
+ ib_object.maturity(maturity).to_java
89
+ ib_object.issueDate(issue_date).to_java
90
+ ib_object.nextOptionDate(next_option_date).to_java
91
+ ib_object.nextOptionType(next_option_type).to_java
92
+ ib_object.nextOptionPartial(next_option_partial).to_java
93
+ ib_object.notes(notes).to_java
94
+
95
+ ib_object
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,26 @@
1
+ # ---------------------------------------------
2
+ # File generated automatically by ib_ruby_proxy
3
+ # ---------------------------------------------
4
+
5
+ module IbRubyProxy
6
+ module Client
7
+ module Ib
8
+ DeltaNeutralContract = Struct.new(:conid, :delta, :price, keyword_init: true) do
9
+ def initialize(conid: 0, delta: 0, price: 0)
10
+ self.conid = conid
11
+ self.delta = delta
12
+ self.price = price
13
+ end
14
+
15
+ def to_ib
16
+ ib_object = Java::ComIbClient::DeltaNeutralContract.new
17
+ ib_object.conid(conid).to_java
18
+ ib_object.delta(delta).to_java
19
+ ib_object.price(price).to_java
20
+
21
+ ib_object
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # ---------------------------------------------
2
+ # File generated automatically by ib_ruby_proxy
3
+ # ---------------------------------------------
4
+
5
+ module IbRubyProxy
6
+ module Client
7
+ module Ib
8
+ HistoricalTick = Struct.new(:time, :price, :size, keyword_init: true) do
9
+ def initialize(time: nil, price: 0, size: nil)
10
+ self.time = time
11
+ self.price = price
12
+ self.size = size
13
+ end
14
+
15
+ def to_ib
16
+ ib_object = Java::ComIbClient::HistoricalTick.new
17
+ ib_object.time(time).to_java
18
+ ib_object.price(price).to_java
19
+ ib_object.size(size).to_java
20
+
21
+ ib_object
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,32 @@
1
+ # ---------------------------------------------
2
+ # File generated automatically by ib_ruby_proxy
3
+ # ---------------------------------------------
4
+
5
+ module IbRubyProxy
6
+ module Client
7
+ module Ib
8
+ HistoricalTickBidAsk = Struct.new(:time, :tick_attrib_bid_ask, :price_bid, :price_ask, :size_bid, :size_ask, keyword_init: true) do
9
+ def initialize(time: nil, tick_attrib_bid_ask: nil, price_bid: 0, price_ask: 0, size_bid: nil, size_ask: nil)
10
+ self.time = time
11
+ self.tick_attrib_bid_ask = tick_attrib_bid_ask
12
+ self.price_bid = price_bid
13
+ self.price_ask = price_ask
14
+ self.size_bid = size_bid
15
+ self.size_ask = size_ask
16
+ end
17
+
18
+ def to_ib
19
+ ib_object = Java::ComIbClient::HistoricalTickBidAsk.new
20
+ ib_object.time(time).to_java
21
+ ib_object.tickAttribBidAsk(tick_attrib_bid_ask).to_java
22
+ ib_object.priceBid(price_bid).to_java
23
+ ib_object.priceAsk(price_ask).to_java
24
+ ib_object.sizeBid(size_bid).to_java
25
+ ib_object.sizeAsk(size_ask).to_java
26
+
27
+ ib_object
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ # ---------------------------------------------
2
+ # File generated automatically by ib_ruby_proxy
3
+ # ---------------------------------------------
4
+
5
+ module IbRubyProxy
6
+ module Client
7
+ module Ib
8
+ HistoricalTickLast = Struct.new(:time, :tick_attrib_last, :price, :size, :exchange, :special_conditions, keyword_init: true) do
9
+ def initialize(time: nil, tick_attrib_last: nil, price: 0, size: nil, exchange: nil, special_conditions: nil)
10
+ self.time = time
11
+ self.tick_attrib_last = tick_attrib_last
12
+ self.price = price
13
+ self.size = size
14
+ self.exchange = exchange
15
+ self.special_conditions = special_conditions
16
+ end
17
+
18
+ def to_ib
19
+ ib_object = Java::ComIbClient::HistoricalTickLast.new
20
+ ib_object.time(time).to_java
21
+ ib_object.tickAttribLast(tick_attrib_last).to_java
22
+ ib_object.price(price).to_java
23
+ ib_object.size(size).to_java
24
+ ib_object.exchange(exchange).to_java
25
+ ib_object.specialConditions(special_conditions).to_java
26
+
27
+ ib_object
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,262 @@
1
+ # ---------------------------------------------
2
+ # File generated automatically by ib_ruby_proxy
3
+ # ---------------------------------------------
4
+
5
+ module IbRubyProxy
6
+ module Client
7
+ module Ib
8
+ Order = Struct.new(:client_id, :order_id, :perm_id, :parent_id, :action, :total_quantity, :display_size, :order_type, :lmt_price, :aux_price, :tif, :account, :settling_firm, :clearing_account, :clearing_intent, :all_or_none, :block_order, :hidden, :outside_rth, :sweep_to_fill, :percent_offset, :trailing_percent, :trail_stop_price, :min_qty, :good_after_time, :good_till_date, :oca_group, :order_ref, :rule80_a, :oca_type, :trigger_method, :active_start_time, :active_stop_time, :fa_group, :fa_method, :fa_percentage, :fa_profile, :volatility, :volatility_type, :continuous_update, :reference_price_type, :delta_neutral_order_type, :delta_neutral_aux_price, :delta_neutral_con_id, :delta_neutral_open_close, :delta_neutral_short_sale, :delta_neutral_short_sale_slot, :delta_neutral_designated_location, :scale_init_level_size, :scale_subs_level_size, :scale_price_increment, :scale_price_adjust_value, :scale_price_adjust_interval, :scale_profit_offset, :scale_auto_reset, :scale_init_position, :scale_init_fill_qty, :scale_random_percent, :scale_table, :hedge_type, :hedge_param, :algo_strategy, :algo_params, :algo_id, :smart_combo_routing_params, :order_combo_legs, :what_if, :transmit, :override_percentage_constraints, :open_close, :origin, :short_sale_slot, :designated_location, :exempt_code, :delta_neutral_settling_firm, :delta_neutral_clearing_account, :delta_neutral_clearing_intent, :discretionary_amt, :e_trade_only, :firm_quote_only, :nbbo_price_cap, :opt_out_smart_routing, :auction_strategy, :starting_price, :stock_ref_price, :delta, :stock_range_lower, :stock_range_upper, :basis_points, :basis_points_type, :not_held, :order_misc_options, :solicited, :randomize_size, :randomize_price, :reference_contract_id, :pegged_change_amount, :is_pegged_change_amount_decrease, :reference_change_amount, :reference_exchange_id, :adjusted_order_type, :trigger_price, :adjusted_stop_price, :adjusted_stop_limit_price, :adjusted_trailing_amount, :adjustable_trailing_unit, :lmt_price_offset, :conditions, :conditions_cancel_order, :conditions_ignore_rth, :model_code, :ext_operator, :soft_dollar_tier, :cash_qty, :mifid2_decision_maker, :mifid2_decision_algo, :mifid2_execution_trader, :mifid2_execution_algo, :dont_use_auto_price_for_hedge, :is_oms_container, :discretionary_up_to_limit_price, keyword_init: true) do
9
+ def initialize(client_id: 0, order_id: 0, perm_id: 0, parent_id: 0, action: nil, total_quantity: 0, display_size: 0, order_type: nil, lmt_price: 0, aux_price: 0, tif: nil, account: nil, settling_firm: nil, clearing_account: nil, clearing_intent: nil, all_or_none: false, block_order: false, hidden: false, outside_rth: false, sweep_to_fill: false, percent_offset: 0, trailing_percent: 0, trail_stop_price: 0, min_qty: 0, good_after_time: nil, good_till_date: nil, oca_group: nil, order_ref: nil, rule80_a: nil, oca_type: 0, trigger_method: 0, active_start_time: nil, active_stop_time: nil, fa_group: nil, fa_method: nil, fa_percentage: nil, fa_profile: nil, volatility: 0, volatility_type: 0, continuous_update: 0, reference_price_type: 0, delta_neutral_order_type: nil, delta_neutral_aux_price: 0, delta_neutral_con_id: 0, delta_neutral_open_close: nil, delta_neutral_short_sale: false, delta_neutral_short_sale_slot: 0, delta_neutral_designated_location: nil, scale_init_level_size: 0, scale_subs_level_size: 0, scale_price_increment: 0, scale_price_adjust_value: 0, scale_price_adjust_interval: 0, scale_profit_offset: 0, scale_auto_reset: false, scale_init_position: 0, scale_init_fill_qty: 0, scale_random_percent: false, scale_table: nil, hedge_type: nil, hedge_param: nil, algo_strategy: nil, algo_params: nil, algo_id: nil, smart_combo_routing_params: nil, order_combo_legs: nil, what_if: false, transmit: false, override_percentage_constraints: false, open_close: nil, origin: 0, short_sale_slot: 0, designated_location: nil, exempt_code: 0, delta_neutral_settling_firm: nil, delta_neutral_clearing_account: nil, delta_neutral_clearing_intent: nil, discretionary_amt: 0, e_trade_only: false, firm_quote_only: false, nbbo_price_cap: 0, opt_out_smart_routing: false, auction_strategy: 0, starting_price: 0, stock_ref_price: 0, delta: 0, stock_range_lower: 0, stock_range_upper: 0, basis_points: 0, basis_points_type: 0, not_held: false, order_misc_options: nil, solicited: false, randomize_size: false, randomize_price: false, reference_contract_id: 0, pegged_change_amount: 0, is_pegged_change_amount_decrease: false, reference_change_amount: 0, reference_exchange_id: nil, adjusted_order_type: nil, trigger_price: 0, adjusted_stop_price: 0, adjusted_stop_limit_price: 0, adjusted_trailing_amount: 0, adjustable_trailing_unit: 0, lmt_price_offset: 0, conditions: nil, conditions_cancel_order: false, conditions_ignore_rth: false, model_code: nil, ext_operator: nil, soft_dollar_tier: nil, cash_qty: 0, mifid2_decision_maker: nil, mifid2_decision_algo: nil, mifid2_execution_trader: nil, mifid2_execution_algo: nil, dont_use_auto_price_for_hedge: false, is_oms_container: false, discretionary_up_to_limit_price: false)
10
+ self.client_id = client_id
11
+ self.order_id = order_id
12
+ self.perm_id = perm_id
13
+ self.parent_id = parent_id
14
+ self.action = action
15
+ self.total_quantity = total_quantity
16
+ self.display_size = display_size
17
+ self.order_type = order_type
18
+ self.lmt_price = lmt_price
19
+ self.aux_price = aux_price
20
+ self.tif = tif
21
+ self.account = account
22
+ self.settling_firm = settling_firm
23
+ self.clearing_account = clearing_account
24
+ self.clearing_intent = clearing_intent
25
+ self.all_or_none = all_or_none
26
+ self.block_order = block_order
27
+ self.hidden = hidden
28
+ self.outside_rth = outside_rth
29
+ self.sweep_to_fill = sweep_to_fill
30
+ self.percent_offset = percent_offset
31
+ self.trailing_percent = trailing_percent
32
+ self.trail_stop_price = trail_stop_price
33
+ self.min_qty = min_qty
34
+ self.good_after_time = good_after_time
35
+ self.good_till_date = good_till_date
36
+ self.oca_group = oca_group
37
+ self.order_ref = order_ref
38
+ self.rule80_a = rule80_a
39
+ self.oca_type = oca_type
40
+ self.trigger_method = trigger_method
41
+ self.active_start_time = active_start_time
42
+ self.active_stop_time = active_stop_time
43
+ self.fa_group = fa_group
44
+ self.fa_method = fa_method
45
+ self.fa_percentage = fa_percentage
46
+ self.fa_profile = fa_profile
47
+ self.volatility = volatility
48
+ self.volatility_type = volatility_type
49
+ self.continuous_update = continuous_update
50
+ self.reference_price_type = reference_price_type
51
+ self.delta_neutral_order_type = delta_neutral_order_type
52
+ self.delta_neutral_aux_price = delta_neutral_aux_price
53
+ self.delta_neutral_con_id = delta_neutral_con_id
54
+ self.delta_neutral_open_close = delta_neutral_open_close
55
+ self.delta_neutral_short_sale = delta_neutral_short_sale
56
+ self.delta_neutral_short_sale_slot = delta_neutral_short_sale_slot
57
+ self.delta_neutral_designated_location = delta_neutral_designated_location
58
+ self.scale_init_level_size = scale_init_level_size
59
+ self.scale_subs_level_size = scale_subs_level_size
60
+ self.scale_price_increment = scale_price_increment
61
+ self.scale_price_adjust_value = scale_price_adjust_value
62
+ self.scale_price_adjust_interval = scale_price_adjust_interval
63
+ self.scale_profit_offset = scale_profit_offset
64
+ self.scale_auto_reset = scale_auto_reset
65
+ self.scale_init_position = scale_init_position
66
+ self.scale_init_fill_qty = scale_init_fill_qty
67
+ self.scale_random_percent = scale_random_percent
68
+ self.scale_table = scale_table
69
+ self.hedge_type = hedge_type
70
+ self.hedge_param = hedge_param
71
+ self.algo_strategy = algo_strategy
72
+ self.algo_params = algo_params
73
+ self.algo_id = algo_id
74
+ self.smart_combo_routing_params = smart_combo_routing_params
75
+ self.order_combo_legs = order_combo_legs
76
+ self.what_if = what_if
77
+ self.transmit = transmit
78
+ self.override_percentage_constraints = override_percentage_constraints
79
+ self.open_close = open_close
80
+ self.origin = origin
81
+ self.short_sale_slot = short_sale_slot
82
+ self.designated_location = designated_location
83
+ self.exempt_code = exempt_code
84
+ self.delta_neutral_settling_firm = delta_neutral_settling_firm
85
+ self.delta_neutral_clearing_account = delta_neutral_clearing_account
86
+ self.delta_neutral_clearing_intent = delta_neutral_clearing_intent
87
+ self.discretionary_amt = discretionary_amt
88
+ self.e_trade_only = e_trade_only
89
+ self.firm_quote_only = firm_quote_only
90
+ self.nbbo_price_cap = nbbo_price_cap
91
+ self.opt_out_smart_routing = opt_out_smart_routing
92
+ self.auction_strategy = auction_strategy
93
+ self.starting_price = starting_price
94
+ self.stock_ref_price = stock_ref_price
95
+ self.delta = delta
96
+ self.stock_range_lower = stock_range_lower
97
+ self.stock_range_upper = stock_range_upper
98
+ self.basis_points = basis_points
99
+ self.basis_points_type = basis_points_type
100
+ self.not_held = not_held
101
+ self.order_misc_options = order_misc_options
102
+ self.solicited = solicited
103
+ self.randomize_size = randomize_size
104
+ self.randomize_price = randomize_price
105
+ self.reference_contract_id = reference_contract_id
106
+ self.pegged_change_amount = pegged_change_amount
107
+ self.is_pegged_change_amount_decrease = is_pegged_change_amount_decrease
108
+ self.reference_change_amount = reference_change_amount
109
+ self.reference_exchange_id = reference_exchange_id
110
+ self.adjusted_order_type = adjusted_order_type
111
+ self.trigger_price = trigger_price
112
+ self.adjusted_stop_price = adjusted_stop_price
113
+ self.adjusted_stop_limit_price = adjusted_stop_limit_price
114
+ self.adjusted_trailing_amount = adjusted_trailing_amount
115
+ self.adjustable_trailing_unit = adjustable_trailing_unit
116
+ self.lmt_price_offset = lmt_price_offset
117
+ self.conditions = conditions
118
+ self.conditions_cancel_order = conditions_cancel_order
119
+ self.conditions_ignore_rth = conditions_ignore_rth
120
+ self.model_code = model_code
121
+ self.ext_operator = ext_operator
122
+ self.soft_dollar_tier = soft_dollar_tier
123
+ self.cash_qty = cash_qty
124
+ self.mifid2_decision_maker = mifid2_decision_maker
125
+ self.mifid2_decision_algo = mifid2_decision_algo
126
+ self.mifid2_execution_trader = mifid2_execution_trader
127
+ self.mifid2_execution_algo = mifid2_execution_algo
128
+ self.dont_use_auto_price_for_hedge = dont_use_auto_price_for_hedge
129
+ self.is_oms_container = is_oms_container
130
+ self.discretionary_up_to_limit_price = discretionary_up_to_limit_price
131
+ end
132
+
133
+ def to_ib
134
+ ib_object = Java::ComIbClient::Order.new
135
+ ib_object.clientId(client_id).to_java
136
+ ib_object.orderId(order_id).to_java
137
+ ib_object.permId(perm_id).to_java
138
+ ib_object.parentId(parent_id).to_java
139
+ ib_object.action(action).to_java
140
+ ib_object.totalQuantity(total_quantity).to_java
141
+ ib_object.displaySize(display_size).to_java
142
+ ib_object.orderType(order_type).to_java
143
+ ib_object.lmtPrice(lmt_price).to_java
144
+ ib_object.auxPrice(aux_price).to_java
145
+ ib_object.tif(tif).to_java
146
+ ib_object.account(account).to_java
147
+ ib_object.settlingFirm(settling_firm).to_java
148
+ ib_object.clearingAccount(clearing_account).to_java
149
+ ib_object.clearingIntent(clearing_intent).to_java
150
+ ib_object.allOrNone(all_or_none).to_java
151
+ ib_object.blockOrder(block_order).to_java
152
+ ib_object.hidden(hidden).to_java
153
+ ib_object.outsideRth(outside_rth).to_java
154
+ ib_object.sweepToFill(sweep_to_fill).to_java
155
+ ib_object.percentOffset(percent_offset).to_java
156
+ ib_object.trailingPercent(trailing_percent).to_java
157
+ ib_object.trailStopPrice(trail_stop_price).to_java
158
+ ib_object.minQty(min_qty).to_java
159
+ ib_object.goodAfterTime(good_after_time).to_java
160
+ ib_object.goodTillDate(good_till_date).to_java
161
+ ib_object.ocaGroup(oca_group).to_java
162
+ ib_object.orderRef(order_ref).to_java
163
+ ib_object.rule80A(rule80_a).to_java
164
+ ib_object.ocaType(oca_type).to_java
165
+ ib_object.triggerMethod(trigger_method).to_java
166
+ ib_object.activeStartTime(active_start_time).to_java
167
+ ib_object.activeStopTime(active_stop_time).to_java
168
+ ib_object.faGroup(fa_group).to_java
169
+ ib_object.faMethod(fa_method).to_java
170
+ ib_object.faPercentage(fa_percentage).to_java
171
+ ib_object.faProfile(fa_profile).to_java
172
+ ib_object.volatility(volatility).to_java
173
+ ib_object.volatilityType(volatility_type).to_java
174
+ ib_object.continuousUpdate(continuous_update).to_java
175
+ ib_object.referencePriceType(reference_price_type).to_java
176
+ ib_object.deltaNeutralOrderType(delta_neutral_order_type).to_java
177
+ ib_object.deltaNeutralAuxPrice(delta_neutral_aux_price).to_java
178
+ ib_object.deltaNeutralConId(delta_neutral_con_id).to_java
179
+ ib_object.deltaNeutralOpenClose(delta_neutral_open_close).to_java
180
+ ib_object.deltaNeutralShortSale(delta_neutral_short_sale).to_java
181
+ ib_object.deltaNeutralShortSaleSlot(delta_neutral_short_sale_slot).to_java
182
+ ib_object.deltaNeutralDesignatedLocation(delta_neutral_designated_location).to_java
183
+ ib_object.scaleInitLevelSize(scale_init_level_size).to_java
184
+ ib_object.scaleSubsLevelSize(scale_subs_level_size).to_java
185
+ ib_object.scalePriceIncrement(scale_price_increment).to_java
186
+ ib_object.scalePriceAdjustValue(scale_price_adjust_value).to_java
187
+ ib_object.scalePriceAdjustInterval(scale_price_adjust_interval).to_java
188
+ ib_object.scaleProfitOffset(scale_profit_offset).to_java
189
+ ib_object.scaleAutoReset(scale_auto_reset).to_java
190
+ ib_object.scaleInitPosition(scale_init_position).to_java
191
+ ib_object.scaleInitFillQty(scale_init_fill_qty).to_java
192
+ ib_object.scaleRandomPercent(scale_random_percent).to_java
193
+ ib_object.scaleTable(scale_table).to_java
194
+ ib_object.hedgeType(hedge_type).to_java
195
+ ib_object.hedgeParam(hedge_param).to_java
196
+ ib_object.algoStrategy(algo_strategy).to_java
197
+ ib_object.algoParams(algo_params).to_java
198
+ ib_object.algoId(algo_id).to_java
199
+ ib_object.smartComboRoutingParams(smart_combo_routing_params).to_java
200
+ ib_object.orderComboLegs(order_combo_legs).to_java
201
+ ib_object.whatIf(what_if).to_java
202
+ ib_object.transmit(transmit).to_java
203
+ ib_object.overridePercentageConstraints(override_percentage_constraints).to_java
204
+ ib_object.openClose(open_close).to_java
205
+ ib_object.origin(origin).to_java
206
+ ib_object.shortSaleSlot(short_sale_slot).to_java
207
+ ib_object.designatedLocation(designated_location).to_java
208
+ ib_object.exemptCode(exempt_code).to_java
209
+ ib_object.deltaNeutralSettlingFirm(delta_neutral_settling_firm).to_java
210
+ ib_object.deltaNeutralClearingAccount(delta_neutral_clearing_account).to_java
211
+ ib_object.deltaNeutralClearingIntent(delta_neutral_clearing_intent).to_java
212
+ ib_object.discretionaryAmt(discretionary_amt).to_java
213
+ ib_object.eTradeOnly(e_trade_only).to_java
214
+ ib_object.firmQuoteOnly(firm_quote_only).to_java
215
+ ib_object.nbboPriceCap(nbbo_price_cap).to_java
216
+ ib_object.optOutSmartRouting(opt_out_smart_routing).to_java
217
+ ib_object.auctionStrategy(auction_strategy).to_java
218
+ ib_object.startingPrice(starting_price).to_java
219
+ ib_object.stockRefPrice(stock_ref_price).to_java
220
+ ib_object.delta(delta).to_java
221
+ ib_object.stockRangeLower(stock_range_lower).to_java
222
+ ib_object.stockRangeUpper(stock_range_upper).to_java
223
+ ib_object.basisPoints(basis_points).to_java
224
+ ib_object.basisPointsType(basis_points_type).to_java
225
+ ib_object.notHeld(not_held).to_java
226
+ ib_object.orderMiscOptions(order_misc_options).to_java
227
+ ib_object.solicited(solicited).to_java
228
+ ib_object.randomizeSize(randomize_size).to_java
229
+ ib_object.randomizePrice(randomize_price).to_java
230
+ ib_object.referenceContractId(reference_contract_id).to_java
231
+ ib_object.peggedChangeAmount(pegged_change_amount).to_java
232
+ ib_object.isPeggedChangeAmountDecrease(is_pegged_change_amount_decrease).to_java
233
+ ib_object.referenceChangeAmount(reference_change_amount).to_java
234
+ ib_object.referenceExchangeId(reference_exchange_id).to_java
235
+ ib_object.adjustedOrderType(adjusted_order_type).to_java
236
+ ib_object.triggerPrice(trigger_price).to_java
237
+ ib_object.adjustedStopPrice(adjusted_stop_price).to_java
238
+ ib_object.adjustedStopLimitPrice(adjusted_stop_limit_price).to_java
239
+ ib_object.adjustedTrailingAmount(adjusted_trailing_amount).to_java
240
+ ib_object.adjustableTrailingUnit(adjustable_trailing_unit).to_java
241
+ ib_object.lmtPriceOffset(lmt_price_offset).to_java
242
+ ib_object.conditions(conditions).to_java
243
+ ib_object.conditionsCancelOrder(conditions_cancel_order).to_java
244
+ ib_object.conditionsIgnoreRth(conditions_ignore_rth).to_java
245
+ ib_object.modelCode(model_code).to_java
246
+ ib_object.extOperator(ext_operator).to_java
247
+ ib_object.softDollarTier(soft_dollar_tier).to_java
248
+ ib_object.cashQty(cash_qty).to_java
249
+ ib_object.mifid2DecisionMaker(mifid2_decision_maker).to_java
250
+ ib_object.mifid2DecisionAlgo(mifid2_decision_algo).to_java
251
+ ib_object.mifid2ExecutionTrader(mifid2_execution_trader).to_java
252
+ ib_object.mifid2ExecutionAlgo(mifid2_execution_algo).to_java
253
+ ib_object.dontUseAutoPriceForHedge(dont_use_auto_price_for_hedge).to_java
254
+ ib_object.isOmsContainer(is_oms_container).to_java
255
+ ib_object.discretionaryUpToLimitPrice(discretionary_up_to_limit_price).to_java
256
+
257
+ ib_object
258
+ end
259
+ end
260
+ end
261
+ end
262
+ end