ib-api 972.0
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.
- checksums.yaml +7 -0
 - data/.gitignore +50 -0
 - data/.rspec +3 -0
 - data/.travis.yml +7 -0
 - data/CODE_OF_CONDUCT.md +74 -0
 - data/Gemfile +16 -0
 - data/Gemfile.lock +105 -0
 - data/Guardfile +24 -0
 - data/LICENSE +674 -0
 - data/README.md +65 -0
 - data/Rakefile +11 -0
 - data/VERSION +1 -0
 - data/api.gemspec +43 -0
 - data/bin/console +95 -0
 - data/bin/console.yml +3 -0
 - data/bin/setup +8 -0
 - data/changelog.md +7 -0
 - data/example/README.md +76 -0
 - data/example/account_info +54 -0
 - data/example/account_positions +30 -0
 - data/example/account_summary +88 -0
 - data/example/cancel_orders +74 -0
 - data/example/fa_accounts +25 -0
 - data/example/fundamental_data +40 -0
 - data/example/historic_data_cli +186 -0
 - data/example/list_orders +45 -0
 - data/example/portfolio_csv +81 -0
 - data/example/scanner_data +62 -0
 - data/example/template +19 -0
 - data/example/tick_data +28 -0
 - data/lib/extensions/class-extensions.rb +87 -0
 - data/lib/ib-api.rb +7 -0
 - data/lib/ib/base.rb +103 -0
 - data/lib/ib/base_properties.rb +160 -0
 - data/lib/ib/connection.rb +450 -0
 - data/lib/ib/constants.rb +393 -0
 - data/lib/ib/errors.rb +44 -0
 - data/lib/ib/logger.rb +26 -0
 - data/lib/ib/messages.rb +99 -0
 - data/lib/ib/messages/abstract_message.rb +101 -0
 - data/lib/ib/messages/incoming.rb +251 -0
 - data/lib/ib/messages/incoming/abstract_message.rb +116 -0
 - data/lib/ib/messages/incoming/account_value.rb +78 -0
 - data/lib/ib/messages/incoming/alert.rb +34 -0
 - data/lib/ib/messages/incoming/contract_data.rb +102 -0
 - data/lib/ib/messages/incoming/delta_neutral_validation.rb +23 -0
 - data/lib/ib/messages/incoming/execution_data.rb +50 -0
 - data/lib/ib/messages/incoming/historical_data.rb +84 -0
 - data/lib/ib/messages/incoming/market_depths.rb +44 -0
 - data/lib/ib/messages/incoming/next_valid_id.rb +18 -0
 - data/lib/ib/messages/incoming/open_order.rb +277 -0
 - data/lib/ib/messages/incoming/order_status.rb +85 -0
 - data/lib/ib/messages/incoming/portfolio_value.rb +78 -0
 - data/lib/ib/messages/incoming/real_time_bar.rb +32 -0
 - data/lib/ib/messages/incoming/scanner_data.rb +54 -0
 - data/lib/ib/messages/incoming/ticks.rb +268 -0
 - data/lib/ib/messages/outgoing.rb +437 -0
 - data/lib/ib/messages/outgoing/abstract_message.rb +88 -0
 - data/lib/ib/messages/outgoing/account_requests.rb +112 -0
 - data/lib/ib/messages/outgoing/bar_requests.rb +250 -0
 - data/lib/ib/messages/outgoing/place_order.rb +209 -0
 - data/lib/ib/messages/outgoing/request_marketdata.rb +99 -0
 - data/lib/ib/messages/outgoing/request_tick_data.rb +21 -0
 - data/lib/ib/model.rb +4 -0
 - data/lib/ib/models.rb +14 -0
 - data/lib/ib/server_versions.rb +114 -0
 - data/lib/ib/socket.rb +185 -0
 - data/lib/ib/support.rb +160 -0
 - data/lib/ib/version.rb +6 -0
 - data/lib/models/ib/account.rb +85 -0
 - data/lib/models/ib/account_value.rb +33 -0
 - data/lib/models/ib/bag.rb +55 -0
 - data/lib/models/ib/bar.rb +31 -0
 - data/lib/models/ib/combo_leg.rb +105 -0
 - data/lib/models/ib/condition.rb +245 -0
 - data/lib/models/ib/contract.rb +415 -0
 - data/lib/models/ib/contract_detail.rb +108 -0
 - data/lib/models/ib/execution.rb +67 -0
 - data/lib/models/ib/forex.rb +13 -0
 - data/lib/models/ib/future.rb +15 -0
 - data/lib/models/ib/index.rb +15 -0
 - data/lib/models/ib/option.rb +78 -0
 - data/lib/models/ib/option_detail.rb +55 -0
 - data/lib/models/ib/order.rb +519 -0
 - data/lib/models/ib/order_state.rb +152 -0
 - data/lib/models/ib/portfolio_value.rb +64 -0
 - data/lib/models/ib/stock.rb +16 -0
 - data/lib/models/ib/underlying.rb +34 -0
 - data/lib/models/ib/vertical.rb +96 -0
 - data/lib/requires.rb +12 -0
 - metadata +203 -0
 
| 
         @@ -0,0 +1,209 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module IB
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Messages
         
     | 
| 
      
 3 
     | 
    
         
            +
                module Outgoing
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
                  # Data format is { :id => int: local_id,
         
     | 
| 
      
 6 
     | 
    
         
            +
                  #                  :contract => Contract,
         
     | 
| 
      
 7 
     | 
    
         
            +
                  #                  :order => Order }
         
     | 
| 
      
 8 
     | 
    
         
            +
                  PlaceOrder = def_message [3, 45]				## ServerVersion > 145:  def_message[ 0,45 ]
         
     | 
| 
      
 9 
     | 
    
         
            +
            																							## server-version is not known at compilation time
         
     | 
| 
      
 10 
     | 
    
         
            +
            																							## Method call has to be replaced then
         
     | 
| 
      
 11 
     | 
    
         
            +
            																							## Max-Client_ver --> 144!!
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                  class PlaceOrder
         
     | 
| 
      
 14 
     | 
    
         
            +
            				
         
     | 
| 
      
 15 
     | 
    
         
            +
                    def encode
         
     | 
| 
      
 16 
     | 
    
         
            +
            #					server_version = Connection.current.server_version
         
     | 
| 
      
 17 
     | 
    
         
            +
                      order = @data[:order]
         
     | 
| 
      
 18 
     | 
    
         
            +
                      contract = @data[:contract]
         
     | 
| 
      
 19 
     | 
    
         
            +
            					error "contract has to be specified" unless contract.is_a? IB::Contract
         
     | 
| 
      
 20 
     | 
    
         
            +
                     [super[0..-1],
         
     | 
| 
      
 21 
     | 
    
         
            +
            #	  [ [3,45, @data[:local_id] ],
         
     | 
| 
      
 22 
     | 
    
         
            +
                       contract.serialize_short(:primary_exchange, :sec_id_type),
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                       # main order fields
         
     | 
| 
      
 25 
     | 
    
         
            +
                       (order.side == :short ? 'SSHORT' : order.side == :short_exempt ? 'SSHORTX' : order.side.to_sup),
         
     | 
| 
      
 26 
     | 
    
         
            +
            					 order.total_quantity,
         
     | 
| 
      
 27 
     | 
    
         
            +
                       order[:order_type], # Internal code, 'LMT' instead of :limit
         
     | 
| 
      
 28 
     | 
    
         
            +
                       order.limit_price,		
         
     | 
| 
      
 29 
     | 
    
         
            +
                       order.aux_price,
         
     | 
| 
      
 30 
     | 
    
         
            +
                       order[:tif],
         
     | 
| 
      
 31 
     | 
    
         
            +
                       order.oca_group,
         
     | 
| 
      
 32 
     | 
    
         
            +
                       order.account,
         
     | 
| 
      
 33 
     | 
    
         
            +
                       order.open_close.to_sup[0],
         
     | 
| 
      
 34 
     | 
    
         
            +
                       order[:origin],  # translates :customer, :firm  to 0,1
         
     | 
| 
      
 35 
     | 
    
         
            +
                       order.order_ref,
         
     | 
| 
      
 36 
     | 
    
         
            +
                       order.transmit,
         
     | 
| 
      
 37 
     | 
    
         
            +
                       order.parent_id,
         
     | 
| 
      
 38 
     | 
    
         
            +
                       order.block_order || false,
         
     | 
| 
      
 39 
     | 
    
         
            +
                       order.sweep_to_fill || false,
         
     | 
| 
      
 40 
     | 
    
         
            +
                       order.display_size,
         
     | 
| 
      
 41 
     | 
    
         
            +
                       order[:trigger_method],
         
     | 
| 
      
 42 
     | 
    
         
            +
                       order.outside_rth || false, # was: ignore_rth
         
     | 
| 
      
 43 
     | 
    
         
            +
                       order.hidden || false,
         
     | 
| 
      
 44 
     | 
    
         
            +
                       contract.serialize_legs(:extended),
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
                       if contract.bag?
         
     | 
| 
      
 48 
     | 
    
         
            +
                         [
         
     | 
| 
      
 49 
     | 
    
         
            +
                           ## Support for per-leg prices in Order
         
     | 
| 
      
 50 
     | 
    
         
            +
                           [contract.combo_legs.size] + contract.combo_legs.map { |_| nil }, #(&:price) ,
         
     | 
| 
      
 51 
     | 
    
         
            +
                           ## Support for combo routing params in Order
         
     | 
| 
      
 52 
     | 
    
         
            +
                           order.combo_params.empty? ? 0 : [order.combo_params.size] + order.combo_params.to_a
         
     | 
| 
      
 53 
     | 
    
         
            +
            	     ]
         
     | 
| 
      
 54 
     | 
    
         
            +
            	        else     
         
     | 
| 
      
 55 
     | 
    
         
            +
            	          []    
         
     | 
| 
      
 56 
     | 
    
         
            +
            	  end,	      
         
     | 
| 
      
 57 
     | 
    
         
            +
            	     
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
                       "", # deprecated shares_allocation field
         
     | 
| 
      
 60 
     | 
    
         
            +
                       order.discretionary_amount,	    
         
     | 
| 
      
 61 
     | 
    
         
            +
                       order.good_after_time,
         
     | 
| 
      
 62 
     | 
    
         
            +
                       order.good_till_date,
         
     | 
| 
      
 63 
     | 
    
         
            +
                       [ order.fa_group,
         
     | 
| 
      
 64 
     | 
    
         
            +
                       order.fa_method,
         
     | 
| 
      
 65 
     | 
    
         
            +
                       order.fa_percentage,
         
     | 
| 
      
 66 
     | 
    
         
            +
                       order.fa_profile ] ,
         
     | 
| 
      
 67 
     | 
    
         
            +
            	   order.model_code || "",
         
     | 
| 
      
 68 
     | 
    
         
            +
                       order[:short_sale_slot] || 0 , # 0 only for retail, 1 or 2 for institution  (Institutional)
         
     | 
| 
      
 69 
     | 
    
         
            +
                       order.designated_location, # only populate when short_sale_slot == 2    (Institutional)
         
     | 
| 
      
 70 
     | 
    
         
            +
                       order.exempt_code,
         
     | 
| 
      
 71 
     | 
    
         
            +
                       order[:oca_type],
         
     | 
| 
      
 72 
     | 
    
         
            +
                       order[:rule_80a], #.to_sup[0..0],
         
     | 
| 
      
 73 
     | 
    
         
            +
                       order.settling_firm,
         
     | 
| 
      
 74 
     | 
    
         
            +
                       order.all_or_none || false,
         
     | 
| 
      
 75 
     | 
    
         
            +
                       order.min_quantity || "",
         
     | 
| 
      
 76 
     | 
    
         
            +
                       order.percent_offset || '',
         
     | 
| 
      
 77 
     | 
    
         
            +
                       order.etrade_only || false,
         
     | 
| 
      
 78 
     | 
    
         
            +
                       order.firm_quote_only || false,
         
     | 
| 
      
 79 
     | 
    
         
            +
                       order.nbbo_price_cap || "",
         
     | 
| 
      
 80 
     | 
    
         
            +
                       order[:auction_strategy],
         
     | 
| 
      
 81 
     | 
    
         
            +
                       order.starting_price,
         
     | 
| 
      
 82 
     | 
    
         
            +
                       order.stock_ref_price || "",
         
     | 
| 
      
 83 
     | 
    
         
            +
                       order.delta || "",
         
     | 
| 
      
 84 
     | 
    
         
            +
                       order.stock_range_lower || "",
         
     | 
| 
      
 85 
     | 
    
         
            +
                       order.stock_range_upper || "",
         
     | 
| 
      
 86 
     | 
    
         
            +
                       order.override_percentage_constraints || false,
         
     | 
| 
      
 87 
     | 
    
         
            +
            					 if order.volatility.present?
         
     | 
| 
      
 88 
     | 
    
         
            +
                       [ order.volatility , #              Volatility orders
         
     | 
| 
      
 89 
     | 
    
         
            +
                       order[:volatility_type] || 2 ] #     default: annual volatility
         
     | 
| 
      
 90 
     | 
    
         
            +
            						else
         
     | 
| 
      
 91 
     | 
    
         
            +
            						["",""]
         
     | 
| 
      
 92 
     | 
    
         
            +
            					 end,
         
     | 
| 
      
 93 
     | 
    
         
            +
                       # Support for delta neutral orders with parameters
         
     | 
| 
      
 94 
     | 
    
         
            +
                       if order.delta_neutral_order_type && order.delta_neutral_order_type != :none
         
     | 
| 
      
 95 
     | 
    
         
            +
                         [order[:delta_neutral_order_type],
         
     | 
| 
      
 96 
     | 
    
         
            +
                          order.delta_neutral_aux_price || "",
         
     | 
| 
      
 97 
     | 
    
         
            +
                          order.delta_neutral_con_id,
         
     | 
| 
      
 98 
     | 
    
         
            +
                          order.delta_neutral_settling_firm,
         
     | 
| 
      
 99 
     | 
    
         
            +
                          order.delta_neutral_clearing_account,
         
     | 
| 
      
 100 
     | 
    
         
            +
                          order[:delta_neutral_clearing_intent],
         
     | 
| 
      
 101 
     | 
    
         
            +
            							order.delta_neutral_open_close,
         
     | 
| 
      
 102 
     | 
    
         
            +
            							order.delta_neutral_short_sale,
         
     | 
| 
      
 103 
     | 
    
         
            +
            							order.delta_neutral_short_sale_slot,
         
     | 
| 
      
 104 
     | 
    
         
            +
            							order.delta_neutral_designated_location ]
         
     | 
| 
      
 105 
     | 
    
         
            +
                       else
         
     | 
| 
      
 106 
     | 
    
         
            +
                         ['', '']
         
     | 
| 
      
 107 
     | 
    
         
            +
                       end,
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
                       order.continuous_update, #        Volatility orders
         
     | 
| 
      
 110 
     | 
    
         
            +
                       order[:reference_price_type] || "", #   Volatility orders
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
                       order.trail_stop_price || "", #         TRAIL_STOP_LIMIT stop price
         
     | 
| 
      
 113 
     | 
    
         
            +
                       order.trailing_percent || "", #         Support for trailing percent
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
                       order.scale_init_level_size || "", #    Scale Orders
         
     | 
| 
      
 116 
     | 
    
         
            +
                       order.scale_subs_level_size || "", #    Scale Orders
         
     | 
| 
      
 117 
     | 
    
         
            +
                       order.scale_price_increment || "", #    Scale Orders
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                       # Support for extended scale orders parameters
         
     | 
| 
      
 120 
     | 
    
         
            +
                       if order.scale_price_increment && order.scale_price_increment > 0
         
     | 
| 
      
 121 
     | 
    
         
            +
                         [order.scale_price_adjust_value || "",
         
     | 
| 
      
 122 
     | 
    
         
            +
                          order.scale_price_adjust_interval || "",
         
     | 
| 
      
 123 
     | 
    
         
            +
                          order.scale_profit_offset || "",
         
     | 
| 
      
 124 
     | 
    
         
            +
                          order.scale_auto_reset, #  default: false,
         
     | 
| 
      
 125 
     | 
    
         
            +
                          order.scale_init_position || "",
         
     | 
| 
      
 126 
     | 
    
         
            +
                          order.scale_init_fill_qty || "",
         
     | 
| 
      
 127 
     | 
    
         
            +
                          order.scale_random_percent # default: false,
         
     | 
| 
      
 128 
     | 
    
         
            +
                          ]
         
     | 
| 
      
 129 
     | 
    
         
            +
                       else
         
     | 
| 
      
 130 
     | 
    
         
            +
                         []
         
     | 
| 
      
 131 
     | 
    
         
            +
                       end,
         
     | 
| 
      
 132 
     | 
    
         
            +
             
     | 
| 
      
 133 
     | 
    
         
            +
            	      order.scale_table,		 # v 69
         
     | 
| 
      
 134 
     | 
    
         
            +
            	      order.active_start_time || "" ,	 # v 69
         
     | 
| 
      
 135 
     | 
    
         
            +
            	      order.active_stop_time || "" ,	 # v 69
         
     | 
| 
      
 136 
     | 
    
         
            +
             
     | 
| 
      
 137 
     | 
    
         
            +
                       # Support for hedgeType
         
     | 
| 
      
 138 
     | 
    
         
            +
                       order.hedge_type, # MIN_SERVER_VER_HEDGE_ORDERS
         
     | 
| 
      
 139 
     | 
    
         
            +
                       order.hedge_param || [],
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
                       order.opt_out_smart_routing, # MIN_SERVER_VER_OPT_OUT_SMART_ROUTING
         
     | 
| 
      
 142 
     | 
    
         
            +
             
     | 
| 
      
 143 
     | 
    
         
            +
                       order.clearing_account ,
         
     | 
| 
      
 144 
     | 
    
         
            +
                       order.clearing_intent ,
         
     | 
| 
      
 145 
     | 
    
         
            +
                       order.not_held ,
         
     | 
| 
      
 146 
     | 
    
         
            +
                       contract.serialize_under_comp,
         
     | 
| 
      
 147 
     | 
    
         
            +
                       order.serialize_algo(),
         
     | 
| 
      
 148 
     | 
    
         
            +
                       order.what_if,
         
     | 
| 
      
 149 
     | 
    
         
            +
            	   order.serialize_misc_options,      # MIN_SERVER_VER_LINKING
         
     | 
| 
      
 150 
     | 
    
         
            +
            	   order.solicided ,		      # MIN_SERVER_VER_ORDER_SOLICITED
         
     | 
| 
      
 151 
     | 
    
         
            +
            	   order.random_size ,		      # MIN_SERVER_VER_RANDOMIZE_SIZE_AND_PRICE
         
     | 
| 
      
 152 
     | 
    
         
            +
            	   order.random_price ,		      # MIN_SERVER_VER_RANDOMIZE_SIZE_AND_PRICE
         
     | 
| 
      
 153 
     | 
    
         
            +
            	   ( order[:type] == 'PEG BENCH' ? [	# pegged_to_benchmark  v. 102
         
     | 
| 
      
 154 
     | 
    
         
            +
            	    order.reference_contract_id,
         
     | 
| 
      
 155 
     | 
    
         
            +
            	    order.is_pegged_change_amount_decrease,
         
     | 
| 
      
 156 
     | 
    
         
            +
            	    order.pegged_change_amount,
         
     | 
| 
      
 157 
     | 
    
         
            +
            	    order.reference_change_amount,
         
     | 
| 
      
 158 
     | 
    
         
            +
            	    order.reference_exchange_id ] : [] ),
         
     | 
| 
      
 159 
     | 
    
         
            +
            		 order.serialize_conditions ,   # serialisation of conditions outsourced to model file
         
     | 
| 
      
 160 
     | 
    
         
            +
            	   order.adjusted_order_type ,
         
     | 
| 
      
 161 
     | 
    
         
            +
            	   order.trigger_price ,
         
     | 
| 
      
 162 
     | 
    
         
            +
            	   order.limit_price_offset ,
         
     | 
| 
      
 163 
     | 
    
         
            +
            	   order.adjusted_stop_price ,
         
     | 
| 
      
 164 
     | 
    
         
            +
            	   order.adjusted_stop_limit_price ,
         
     | 
| 
      
 165 
     | 
    
         
            +
            	   order.adjusted_trailing_amount ,
         
     | 
| 
      
 166 
     | 
    
         
            +
            	   order.adjustable_trailing_unit ,
         
     | 
| 
      
 167 
     | 
    
         
            +
            	   order.ext_operator ,		      # MIN_SERVER_VER_EXT_OPERATOR:
         
     | 
| 
      
 168 
     | 
    
         
            +
            		 order.soft_dollar_tier_name,
         
     | 
| 
      
 169 
     | 
    
         
            +
            		 order.soft_dollar_tier_value,
         
     | 
| 
      
 170 
     | 
    
         
            +
            		 order.soft_dollar_tier_display_name,
         
     | 
| 
      
 171 
     | 
    
         
            +
            #	   order.serialize_soft_dollar_tier() ,	      # MIN_SERVER_VER_SOFT_DOLLAR_TIER
         
     | 
| 
      
 172 
     | 
    
         
            +
            	   order.cash_qty , 		      # MIN_SERVER_VER_CASH_QTY  /111)
         
     | 
| 
      
 173 
     | 
    
         
            +
            #			 if server_version >= 138   # :min_server_ver_decision_maker 
         
     | 
| 
      
 174 
     | 
    
         
            +
            				 [ order.mifid_2_decision_maker, order.mifid_2_decision_algo],
         
     | 
| 
      
 175 
     | 
    
         
            +
            #				end ,
         
     | 
| 
      
 176 
     | 
    
         
            +
            #				if server_version >= 139 # min_server_ver_mifid_execution  
         
     | 
| 
      
 177 
     | 
    
         
            +
            				[ order.mifid_2_execution_maker, order.mifid_2_execution_algo ],
         
     | 
| 
      
 178 
     | 
    
         
            +
            #				end,
         
     | 
| 
      
 179 
     | 
    
         
            +
            #				if server_version >= 141 # min_server_ver_auto_price_for_hedge 
         
     | 
| 
      
 180 
     | 
    
         
            +
            				order.dont_use_auto_price_for_hedge,
         
     | 
| 
      
 181 
     | 
    
         
            +
            #				end,
         
     | 
| 
      
 182 
     | 
    
         
            +
            #				if server_version >= 145 #	min_server_ver_order_container
         
     | 
| 
      
 183 
     | 
    
         
            +
            					order.is_O_ms_container,
         
     | 
| 
      
 184 
     | 
    
         
            +
            #				end,
         
     | 
| 
      
 185 
     | 
    
         
            +
            #				if server_version >= 148 # 	min_server_ver_d_peg_orders
         
     | 
| 
      
 186 
     | 
    
         
            +
            					order.discretionary_up_to_limit_price
         
     | 
| 
      
 187 
     | 
    
         
            +
            #				end ]
         
     | 
| 
      
 188 
     | 
    
         
            +
            				]
         
     | 
| 
      
 189 
     | 
    
         
            +
            #
         
     | 
| 
      
 190 
     | 
    
         
            +
            #
         
     | 
| 
      
 191 
     | 
    
         
            +
            #
         
     | 
| 
      
 192 
     | 
    
         
            +
            #	   if self.serverVersion() >= MIN_SERVER_VER_AUTO_PRICE_FOR_HEDGE:141
         
     | 
| 
      
 193 
     | 
    
         
            +
            #            flds.append(make_field(order.dontUseAutoPriceForHedge))
         
     | 
| 
      
 194 
     | 
    
         
            +
            #
         
     | 
| 
      
 195 
     | 
    
         
            +
            #        if self.serverVersion() >= MIN_SERVER_VER_ORDER_CONTAINER:145
         
     | 
| 
      
 196 
     | 
    
         
            +
            #            flds.append(make_field(order.isOmsContainer))
         
     | 
| 
      
 197 
     | 
    
         
            +
            #
         
     | 
| 
      
 198 
     | 
    
         
            +
            #        if self.serverVersion() >= MIN_SERVER_VER_D_PEG_ORDERS: 148
         
     | 
| 
      
 199 
     | 
    
         
            +
            #            flds.append(make_field(order.discretionaryUpToLimitPrice))
         
     | 
| 
      
 200 
     | 
    
         
            +
            #
         
     | 
| 
      
 201 
     | 
    
         
            +
            #  
         
     | 
| 
      
 202 
     | 
    
         
            +
             
     | 
| 
      
 203 
     | 
    
         
            +
                    end
         
     | 
| 
      
 204 
     | 
    
         
            +
                  end # PlaceOrder
         
     | 
| 
      
 205 
     | 
    
         
            +
             
     | 
| 
      
 206 
     | 
    
         
            +
             
     | 
| 
      
 207 
     | 
    
         
            +
                end # module Outgoing
         
     | 
| 
      
 208 
     | 
    
         
            +
              end # module Messages
         
     | 
| 
      
 209 
     | 
    
         
            +
            end # module IB
         
     | 
| 
         @@ -0,0 +1,99 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
             
     | 
| 
      
 2 
     | 
    
         
            +
            module IB
         
     | 
| 
      
 3 
     | 
    
         
            +
              module Messages
         
     | 
| 
      
 4 
     | 
    
         
            +
                module Outgoing
         
     | 
| 
      
 5 
     | 
    
         
            +
                  extend Messages # def_message macros
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                  # @data={:id => int: ticker_id - Must be a unique value. When the market data
         
     | 
| 
      
 9 
     | 
    
         
            +
                  #                                returns, it will be identified by this tag,
         
     | 
| 
      
 10 
     | 
    
         
            +
            			#                                if omitted, id-autogeneration process is performed
         
     | 
| 
      
 11 
     | 
    
         
            +
                  #      :contract => IB::Contract, requested contract.
         
     | 
| 
      
 12 
     | 
    
         
            +
                  #      :tick_list => String: comma delimited list of requested tick groups:
         
     | 
| 
      
 13 
     | 
    
         
            +
                  #        Group ID - Description - Requested Tick Types
         
     | 
| 
      
 14 
     | 
    
         
            +
                  #        100 - Option Volume (currently for stocks) - 29, 30
         
     | 
| 
      
 15 
     | 
    
         
            +
                  #        101 - Option Open Interest (currently for stocks) - 27, 28
         
     | 
| 
      
 16 
     | 
    
         
            +
                  #        104 - Historical Volatility (currently for stocks) - 23
         
     | 
| 
      
 17 
     | 
    
         
            +
                  #	       105 - Average Opt Volume,  # new 971
         
     | 
| 
      
 18 
     | 
    
         
            +
                  #        106 - Option Implied Volatility (impvolat) - 24
         
     | 
| 
      
 19 
     | 
    
         
            +
                  #	       107   (climpvlt)  # new 971
         
     | 
| 
      
 20 
     | 
    
         
            +
                  #	       125   (Bond analytic data) # new 971
         
     | 
| 
      
 21 
     | 
    
         
            +
                  #        162 - Index Future Premium - 31
         
     | 
| 
      
 22 
     | 
    
         
            +
                  #        165 - Miscellaneous Stats - 15, 16, 17, 18, 19, 20, 21
         
     | 
| 
      
 23 
     | 
    
         
            +
                  #	       166  (CScreen)   # new 971,
         
     | 
| 
      
 24 
     | 
    
         
            +
                  #        221/220 - Creditman, Mark Price (used in TWS P&L computations) - 37
         
     | 
| 
      
 25 
     | 
    
         
            +
                  #        225 - Auction values (volume, price and imbalance) - 34, 35, 36
         
     | 
| 
      
 26 
     | 
    
         
            +
                  #	       232/221(Pl-price )  # new 971
         
     | 
| 
      
 27 
     | 
    
         
            +
                  #        233 - RTVolume - 48
         
     | 
| 
      
 28 
     | 
    
         
            +
                  #        236 - Shortable (inventory) - 46
         
     | 
| 
      
 29 
     | 
    
         
            +
                  #        256 - Inventory - ?
         
     | 
| 
      
 30 
     | 
    
         
            +
                  #        258 - Fundamental Ratios - 47
         
     | 
| 
      
 31 
     | 
    
         
            +
                  #        291 - (ivclose)                          
         
     | 
| 
      
 32 
     | 
    
         
            +
                  #        292 - (Wide News)                          
         
     | 
| 
      
 33 
     | 
    
         
            +
                  #        293 - (TradeCount)                          
         
     | 
| 
      
 34 
     | 
    
         
            +
                  #        295 - (VolumeRate)                          
         
     | 
| 
      
 35 
     | 
    
         
            +
                  #        318 - (iLastRTHT-Trade)                          
         
     | 
| 
      
 36 
     | 
    
         
            +
                  #        370 - (Participation Monitor)
         
     | 
| 
      
 37 
     | 
    
         
            +
                  #        375 - RTTrdVolumne
         
     | 
| 
      
 38 
     | 
    
         
            +
                  #        377 - CttTickTag
         
     | 
| 
      
 39 
     | 
    
         
            +
                  #        381 - IB-Rate
         
     | 
| 
      
 40 
     | 
    
         
            +
                  #        384 - RfdTickRespTag
         
     | 
| 
      
 41 
     | 
    
         
            +
                  #        387 -  DMM
         
     | 
| 
      
 42 
     | 
    
         
            +
                  #        388 - Issuer Fundamentals
         
     | 
| 
      
 43 
     | 
    
         
            +
                  #        391 - IBWarrantImplVolCompeteTick
         
     | 
| 
      
 44 
     | 
    
         
            +
                  #        405 - Index Capabilities
         
     | 
| 
      
 45 
     | 
    
         
            +
                  #        407 - Futures Margins
         
     | 
| 
      
 46 
     | 
    
         
            +
                  #        411 - Realtime Historical Volatility - 58
         
     | 
| 
      
 47 
     | 
    
         
            +
                  #        428 - Monetary Close
         
     | 
| 
      
 48 
     | 
    
         
            +
                  #        439 - MonitorTicTag
         
     | 
| 
      
 49 
     | 
    
         
            +
                  #        456/59 - IB Dividends
         
     | 
| 
      
 50 
     | 
    
         
            +
                  #        459 - RTCLOSE
         
     | 
| 
      
 51 
     | 
    
         
            +
                  #        460 - Bond Factor Multiplier
         
     | 
| 
      
 52 
     | 
    
         
            +
                  #        499 - Fee and Rebate Ratge
         
     | 
| 
      
 53 
     | 
    
         
            +
                  #        506 - midptiv
         
     | 
| 
      
 54 
     | 
    
         
            +
                  #
         
     | 
| 
      
 55 
     | 
    
         
            +
                  #        511(hvolrt10 (per-underlying)),
         
     | 
| 
      
 56 
     | 
    
         
            +
                  #        512(hvolrt30 (per-underlying)),
         
     | 
| 
      
 57 
     | 
    
         
            +
                  #        513(hvolrt50 (per-underlying)),
         
     | 
| 
      
 58 
     | 
    
         
            +
                  #        514(hvolrt75 (per-underlying)),
         
     | 
| 
      
 59 
     | 
    
         
            +
                  #        515(hvolrt100 (per-underlying)),
         
     | 
| 
      
 60 
     | 
    
         
            +
                  #        516(hvolrt150 (per-underlying)),
         
     | 
| 
      
 61 
     | 
    
         
            +
                  #        517(hvolrt200 (per-underlying)),
         
     | 
| 
      
 62 
     | 
    
         
            +
                  #        521(fzmidptiv),
         
     | 
| 
      
 63 
     | 
    
         
            +
                  #        545(vsiv),
         
     | 
| 
      
 64 
     | 
    
         
            +
                  #        576(EtfNavBidAsk(navbidask)),
         
     | 
| 
      
 65 
     | 
    
         
            +
                  #        577(EtfNavLast(navlast)),
         
     | 
| 
      
 66 
     | 
    
         
            +
                  #        578(EtfNavClose(navclose)),
         
     | 
| 
      
 67 
     | 
    
         
            +
                  #        584(Average Opening Vol.),
         
     | 
| 
      
 68 
     | 
    
         
            +
                  #        585(Average Closing Vol.),
         
     | 
| 
      
 69 
     | 
    
         
            +
                  #        587(Pl Price Delayed),
         
     | 
| 
      
 70 
     | 
    
         
            +
                  #        588(Futures Open Interest),
         
     | 
| 
      
 71 
     | 
    
         
            +
                  #        595(Short-Term Volume X Mins),
         
     | 
| 
      
 72 
     | 
    
         
            +
                  #        608(EMA N),
         
     | 
| 
      
 73 
     | 
    
         
            +
                  #        614(EtfNavMisc(hight/low)),
         
     | 
| 
      
 74 
     | 
    
         
            +
                  #        619(Creditman Slow Mark Price),
         
     | 
| 
      
 75 
     | 
    
         
            +
                  #        623(EtfFrozenNavLast(fznavlast)	      ## updated 2018/1/21
         
     | 
| 
      
 76 
     | 
    
         
            +
                  #
         
     | 
| 
      
 77 
     | 
    
         
            +
                  #      :snapshot => bool: Check to return a single snapshot of market data and
         
     | 
| 
      
 78 
     | 
    
         
            +
                  #                   have the market data subscription canceled. Do not enter any
         
     | 
| 
      
 79 
     | 
    
         
            +
                  #                   :tick_list values if you use snapshot. 
         
     | 
| 
      
 80 
     | 
    
         
            +
                  #
         
     | 
| 
      
 81 
     | 
    
         
            +
                  #      :regulatory_snapshot => bool - With the US Value Snapshot Bundle for stocks,
         
     | 
| 
      
 82 
     | 
    
         
            +
                  #                   regulatory snapshots are available for 0.01 USD each.
         
     | 
| 
      
 83 
     | 
    
         
            +
                  #      :mktDataOptions => (TagValueList)  For internal use only.
         
     | 
| 
      
 84 
     | 
    
         
            +
                  #                    Use default value XYZ. 
         
     | 
| 
      
 85 
     | 
    
         
            +
                  #
         
     | 
| 
      
 86 
     | 
    
         
            +
                  RequestMarketData =
         
     | 
| 
      
 87 
     | 
    
         
            +
                      def_message [1, 11], :request_id,
         
     | 
| 
      
 88 
     | 
    
         
            +
                                  [:contract, :serialize_short, :primary_exchange],  # include primary exchange in request
         
     | 
| 
      
 89 
     | 
    
         
            +
                                  [:contract, :serialize_legs, []],
         
     | 
| 
      
 90 
     | 
    
         
            +
                                  [:contract, :serialize_under_comp, []],
         
     | 
| 
      
 91 
     | 
    
         
            +
                                  [:tick_list, lambda do |tick_list|
         
     | 
| 
      
 92 
     | 
    
         
            +
                                    tick_list.is_a?(Array) ? tick_list.join(',') : (tick_list || '')
         
     | 
| 
      
 93 
     | 
    
         
            +
                                  end, []],
         
     | 
| 
      
 94 
     | 
    
         
            +
                                  [:snapshot, false],
         
     | 
| 
      
 95 
     | 
    
         
            +
            		      [:regulatory_snapshot, false],
         
     | 
| 
      
 96 
     | 
    
         
            +
            		      [:mkt_data_options, "XYZ"]
         
     | 
| 
      
 97 
     | 
    
         
            +
                end
         
     | 
| 
      
 98 
     | 
    
         
            +
              end
         
     | 
| 
      
 99 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
             
     | 
| 
      
 2 
     | 
    
         
            +
            module IB
         
     | 
| 
      
 3 
     | 
    
         
            +
              module Messages
         
     | 
| 
      
 4 
     | 
    
         
            +
                module Outgoing
         
     | 
| 
      
 5 
     | 
    
         
            +
                  extend Messages # def_message macros
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  RequestTickByTickData = 
         
     | 
| 
      
 10 
     | 
    
         
            +
            											def_message [0, 97], :request_id,			# autogenerated if not specified
         
     | 
| 
      
 11 
     | 
    
         
            +
                                  [:contract, :serialize_short, :primary_exchange],  # include primary exchange in request
         
     | 
| 
      
 12 
     | 
    
         
            +
            											:tick_type,  # a string  supported: "Last", "AllLast", "BidAsk" or "MidPoint".
         
     | 
| 
      
 13 
     | 
    
         
            +
            											# Server_version >= 140
         
     | 
| 
      
 14 
     | 
    
         
            +
            											 :number_of_ticks,  # int
         
     | 
| 
      
 15 
     | 
    
         
            +
            										 :ignore_size      # bool
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                  CancelTickByTickData =
         
     | 
| 
      
 18 
     | 
    
         
            +
                      def_message [0, 98], :request_id
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/ib/model.rb
    ADDED
    
    
    
        data/lib/ib/models.rb
    ADDED
    
    | 
         @@ -0,0 +1,14 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
              require 'ib/model'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
              require 'models/ib/account'
         
     | 
| 
      
 4 
     | 
    
         
            +
              require 'models/ib/account_value'
         
     | 
| 
      
 5 
     | 
    
         
            +
              require 'models/ib/contract_detail'
         
     | 
| 
      
 6 
     | 
    
         
            +
              require 'models/ib/underlying'
         
     | 
| 
      
 7 
     | 
    
         
            +
              require 'models/ib/contract'
         
     | 
| 
      
 8 
     | 
    
         
            +
              require 'models/ib/order_state'
         
     | 
| 
      
 9 
     | 
    
         
            +
              require 'models/ib/portfolio_value'
         
     | 
| 
      
 10 
     | 
    
         
            +
              require 'models/ib/order'
         
     | 
| 
      
 11 
     | 
    
         
            +
              require 'models/ib/combo_leg'
         
     | 
| 
      
 12 
     | 
    
         
            +
              require 'models/ib/execution'
         
     | 
| 
      
 13 
     | 
    
         
            +
              require 'models/ib/bar'
         
     | 
| 
      
 14 
     | 
    
         
            +
            	require 'models/ib/condition'
         
     | 
| 
         @@ -0,0 +1,114 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            =begin
         
     | 
| 
      
 2 
     | 
    
         
            +
            taken from the python-client code
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            Copyright (C) 2016 Interactive Brokers LLC. All rights reserved.  This code is
         
     | 
| 
      
 5 
     | 
    
         
            +
            subject to the terms and conditions of the IB API Non-Commercial License or the
         
     | 
| 
      
 6 
     | 
    
         
            +
             IB API Commercial License, as applicable.
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            The known server versions.
         
     | 
| 
      
 11 
     | 
    
         
            +
            =end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            known_servers = {
         
     | 
| 
      
 14 
     | 
    
         
            +
            #min_server_ver_real_time_bars       => 34,
         
     | 
| 
      
 15 
     | 
    
         
            +
            #min_server_ver_scale_orders         => 35,
         
     | 
| 
      
 16 
     | 
    
         
            +
            #min_server_ver_snapshot_mkt_data    => 35,
         
     | 
| 
      
 17 
     | 
    
         
            +
            #min_server_ver_sshort_combo_legs    => 35,
         
     | 
| 
      
 18 
     | 
    
         
            +
            #min_server_ver_what_if_orders       => 36,
         
     | 
| 
      
 19 
     | 
    
         
            +
            #min_server_ver_contract_conid       => 37,
         
     | 
| 
      
 20 
     | 
    
         
            +
            :min_server_ver_pta_orders             => 39,
         
     | 
| 
      
 21 
     | 
    
         
            +
            :min_server_ver_fundamental_data       => 40,
         
     | 
| 
      
 22 
     | 
    
         
            +
            :min_server_ver_under_comp             => 40,
         
     | 
| 
      
 23 
     | 
    
         
            +
            :min_server_ver_contract_data_chain    => 40,
         
     | 
| 
      
 24 
     | 
    
         
            +
            :min_server_ver_scale_orders2          => 40,
         
     | 
| 
      
 25 
     | 
    
         
            +
            :min_server_ver_algo_orders            => 41,
         
     | 
| 
      
 26 
     | 
    
         
            +
            :min_server_ver_execution_data_chain   => 42,
         
     | 
| 
      
 27 
     | 
    
         
            +
            :min_server_ver_not_held               => 44,
         
     | 
| 
      
 28 
     | 
    
         
            +
            :min_server_ver_sec_id_type            => 45,
         
     | 
| 
      
 29 
     | 
    
         
            +
            :min_server_ver_place_order_conid      => 46,
         
     | 
| 
      
 30 
     | 
    
         
            +
            :min_server_ver_req_mkt_data_conid     => 47,
         
     | 
| 
      
 31 
     | 
    
         
            +
            :min_server_ver_req_calc_implied_volat => 49,
         
     | 
| 
      
 32 
     | 
    
         
            +
            :min_server_ver_req_calc_option_price  => 50,
         
     | 
| 
      
 33 
     | 
    
         
            +
            :min_server_ver_sshortx_old            => 51,
         
     | 
| 
      
 34 
     | 
    
         
            +
            :min_server_ver_sshortx                => 52,
         
     | 
| 
      
 35 
     | 
    
         
            +
            :min_server_ver_req_global_cancel      => 53,
         
     | 
| 
      
 36 
     | 
    
         
            +
            :min_server_ver_hedge_orders           => 54,
         
     | 
| 
      
 37 
     | 
    
         
            +
            :min_server_ver_req_market_data_type   => 55,
         
     | 
| 
      
 38 
     | 
    
         
            +
            :min_server_ver_opt_out_smart_routing  => 56,
         
     | 
| 
      
 39 
     | 
    
         
            +
            :min_server_ver_smart_combo_routing_params => 57,
         
     | 
| 
      
 40 
     | 
    
         
            +
            :min_server_ver_delta_neutral_conid    => 58,
         
     | 
| 
      
 41 
     | 
    
         
            +
            :min_server_ver_scale_orders3          => 60,
         
     | 
| 
      
 42 
     | 
    
         
            +
            :min_server_ver_order_combo_legs_price => 61,
         
     | 
| 
      
 43 
     | 
    
         
            +
            :min_server_ver_trailing_percent       => 62,
         
     | 
| 
      
 44 
     | 
    
         
            +
            :min_server_ver_delta_neutral_open_close => 66,
         
     | 
| 
      
 45 
     | 
    
         
            +
            :min_server_ver_positions              => 67,
         
     | 
| 
      
 46 
     | 
    
         
            +
            :min_server_ver_account_summary        => 67,
         
     | 
| 
      
 47 
     | 
    
         
            +
            :min_server_ver_trading_class          => 68,
         
     | 
| 
      
 48 
     | 
    
         
            +
            :min_server_ver_scale_table            => 69,
         
     | 
| 
      
 49 
     | 
    
         
            +
            :min_server_ver_linking                => 70,
         
     | 
| 
      
 50 
     | 
    
         
            +
            :min_server_ver_algo_id                => 71,
         
     | 
| 
      
 51 
     | 
    
         
            +
            :min_server_ver_optional_capabilities  => 72,
         
     | 
| 
      
 52 
     | 
    
         
            +
            :min_server_ver_order_solicited        => 73,
         
     | 
| 
      
 53 
     | 
    
         
            +
            :min_server_ver_linking_auth           => 74,
         
     | 
| 
      
 54 
     | 
    
         
            +
            :min_server_ver_primaryexch            => 75,
         
     | 
| 
      
 55 
     | 
    
         
            +
            :min_server_ver_randomize_size_and_price => 76,
         
     | 
| 
      
 56 
     | 
    
         
            +
            :min_server_ver_fractional_positions   => 101,
         
     | 
| 
      
 57 
     | 
    
         
            +
            :min_server_ver_pegged_to_benchmark    => 102,
         
     | 
| 
      
 58 
     | 
    
         
            +
            :min_server_ver_models_support         => 103,
         
     | 
| 
      
 59 
     | 
    
         
            +
            :min_server_ver_sec_def_opt_params_req => 104,
         
     | 
| 
      
 60 
     | 
    
         
            +
            :min_server_ver_ext_operator           => 105,
         
     | 
| 
      
 61 
     | 
    
         
            +
            :min_server_ver_soft_dollar_tier       => 106,
         
     | 
| 
      
 62 
     | 
    
         
            +
            :min_server_ver_req_family_codes       => 107,
         
     | 
| 
      
 63 
     | 
    
         
            +
            :min_server_ver_req_matching_symbols   => 108,
         
     | 
| 
      
 64 
     | 
    
         
            +
            :min_server_ver_past_limit             => 109,
         
     | 
| 
      
 65 
     | 
    
         
            +
            :min_server_ver_md_size_multiplier     => 110,
         
     | 
| 
      
 66 
     | 
    
         
            +
            :min_server_ver_cash_qty               => 111,
         
     | 
| 
      
 67 
     | 
    
         
            +
            :min_server_ver_req_mkt_depth_exchanges => 112,
         
     | 
| 
      
 68 
     | 
    
         
            +
            :min_server_ver_tick_news              => 113,
         
     | 
| 
      
 69 
     | 
    
         
            +
            :min_server_ver_req_smart_components   => 114,
         
     | 
| 
      
 70 
     | 
    
         
            +
            :min_server_ver_req_news_providers     => 115,
         
     | 
| 
      
 71 
     | 
    
         
            +
            :min_server_ver_req_news_article       => 116,
         
     | 
| 
      
 72 
     | 
    
         
            +
            :min_server_ver_req_historical_news    => 117,
         
     | 
| 
      
 73 
     | 
    
         
            +
            :min_server_ver_req_head_timestamp     => 118,
         
     | 
| 
      
 74 
     | 
    
         
            +
            :min_server_ver_req_histogram          => 119,
         
     | 
| 
      
 75 
     | 
    
         
            +
            :min_server_ver_service_data_type      => 120,
         
     | 
| 
      
 76 
     | 
    
         
            +
            :min_server_ver_agg_group              => 121,
         
     | 
| 
      
 77 
     | 
    
         
            +
            :min_server_ver_underlying_info        => 122,
         
     | 
| 
      
 78 
     | 
    
         
            +
            :min_server_ver_cancel_headtimestamp   => 123,
         
     | 
| 
      
 79 
     | 
    
         
            +
            :min_server_ver_synt_realtime_bars     => 124,
         
     | 
| 
      
 80 
     | 
    
         
            +
            :min_server_ver_cfd_reroute            => 125,
         
     | 
| 
      
 81 
     | 
    
         
            +
            :min_server_ver_market_rules           => 126,
         
     | 
| 
      
 82 
     | 
    
         
            +
            :min_server_ver_pnl                    => 127,
         
     | 
| 
      
 83 
     | 
    
         
            +
            :min_server_ver_news_query_origins     => 128,
         
     | 
| 
      
 84 
     | 
    
         
            +
            :min_server_ver_unrealized_pnl         => 129,
         
     | 
| 
      
 85 
     | 
    
         
            +
            :min_server_ver_historical_ticks       => 130,
         
     | 
| 
      
 86 
     | 
    
         
            +
            :min_server_ver_market_cap_price       => 131,
         
     | 
| 
      
 87 
     | 
    
         
            +
            :min_server_ver_pre_open_bid_ask       => 132,
         
     | 
| 
      
 88 
     | 
    
         
            +
            :min_server_ver_real_expiration_date   => 134,
         
     | 
| 
      
 89 
     | 
    
         
            +
            :min_server_ver_realized_pnl           => 135,
         
     | 
| 
      
 90 
     | 
    
         
            +
            :min_server_ver_last_liquidity         => 136,
         
     | 
| 
      
 91 
     | 
    
         
            +
            :min_server_ver_tick_by_tick           => 137,
         
     | 
| 
      
 92 
     | 
    
         
            +
            :min_server_ver_decision_maker         => 138,
         
     | 
| 
      
 93 
     | 
    
         
            +
            :min_server_ver_mifid_execution        => 139,
         
     | 
| 
      
 94 
     | 
    
         
            +
            :min_server_ver_tick_by_tick_ignore_size => 140,
         
     | 
| 
      
 95 
     | 
    
         
            +
            :min_server_ver_auto_price_for_hedge     => 141,
         
     | 
| 
      
 96 
     | 
    
         
            +
            :min_server_ver_what_if_ext_fields       => 142,
         
     | 
| 
      
 97 
     | 
    
         
            +
            :min_server_ver_scanner_generic_opts     => 143,
         
     | 
| 
      
 98 
     | 
    
         
            +
            :min_server_ver_api_bind_order           => 144,
         
     | 
| 
      
 99 
     | 
    
         
            +
            :min_server_ver_order_container          => 145, ### > Version Field in Order dropped
         
     | 
| 
      
 100 
     | 
    
         
            +
            :min_server_ver_smart_depth              => 146,
         
     | 
| 
      
 101 
     | 
    
         
            +
            :min_server_ver_remove_null_all_casting  => 147,
         
     | 
| 
      
 102 
     | 
    
         
            +
            :min_server_ver_d_peg_orders             => 148
         
     | 
| 
      
 103 
     | 
    
         
            +
             
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
            }
         
     | 
| 
      
 108 
     | 
    
         
            +
            # 100+ messaging */
         
     | 
| 
      
 109 
     | 
    
         
            +
            # 100 = enhanced handshake, msg length prefixes
         
     | 
| 
      
 110 
     | 
    
         
            +
             
     | 
| 
      
 111 
     | 
    
         
            +
            MIN_CLIENT_VER = 100
         
     | 
| 
      
 112 
     | 
    
         
            +
            MAX_CLIENT_VER = 137 #known_servers[:min_server_ver_d_peg_orders]
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
            # imessages/outgoing/request_tick_Data is prepared for change to ver. 140 , its commented for now
         
     |